Skip to content

Commit

Permalink
Add in missing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Gallagher committed Jul 6, 2018
1 parent fef7439 commit f3eabf7
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
3 changes: 2 additions & 1 deletion graphql/backend/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from abc import ABCMeta, abstractmethod

from ..pyutils.cached_property import cached_property
import six
from ..language import ast

# Necessary for static type checking
if False: # flake8: noqa
Expand Down
4 changes: 2 additions & 2 deletions graphql/language/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def read_string(source, start):

position += 1
if code == 92: # \
append(body[chunk_start : position - 1])
append(body[chunk_start: position - 1])

code = char_code_at(body, position)
escaped = ESCAPED_CHAR_CODES.get(code) # type: ignore
Expand All @@ -392,7 +392,7 @@ def read_string(source, start):
source,
position,
u"Invalid character escape sequence: \\u{}.".format(
body[position + 1 : position + 5]
body[position + 1: position + 5]
),
)

Expand Down
1 change: 0 additions & 1 deletion graphql/pyutils/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,3 @@ def check_threads():
'(Enable the "enable-threads" flag).'
)
)

14 changes: 7 additions & 7 deletions graphql/type/definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,17 +626,17 @@ class GeoPoint(GraphQLInputObjectType):
"""

def __init__(self,
name, # type: str
fields, # type: Union[Callable[[], Dict[str, GraphQLInputObjectField]], Dict[str, GraphQLInputObjectField]]
description=None, # type: Optional[str]
container_type=None, # type: Type[Dict[str, Any]]
):
name, # type: str
fields, # type: Union[Callable[[], Dict[str, GraphQLInputObjectField]], Dict[str, GraphQLInputObjectField]]
description=None, # type: Optional[str]
container_type=None, # type: Type[Dict[str, Any]]
):
# type: (...) -> None
assert name, "Type must be named."
self.name = name
self.description = description
if container_type is None:
container_type = dict # type: ignore
container_type = dict # type: ignore
assert callable(container_type), "container_type must be callable"
self.container_type = container_type
self._fields = fields
Expand Down Expand Up @@ -755,7 +755,7 @@ class RowType(GraphQLObjectType):

def __init__(
self,
type, # type: Union[GraphQLList, GraphQLObjectType, GraphQLScalarType, GraphQLInputObjectType, GraphQLInterfaceType]
type, # type: Union[GraphQLList, GraphQLObjectType, GraphQLScalarType, GraphQLInputObjectType, GraphQLInterfaceType]
):
# type: (...) -> None
assert is_type(type) and not isinstance(
Expand Down
2 changes: 1 addition & 1 deletion graphql/type/tests/test_enum_type.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections import OrderedDict

from rx import Observable
from graphql import graphql
from graphql.type import (
GraphQLArgument,
Expand Down
2 changes: 1 addition & 1 deletion graphql/utils/tests/test_build_ast_schema.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from graphql import GraphQLInt, parse
from graphql.utils.build_ast_schema import build_ast_schema
from graphql.utils.schema_printer import print_schema

from pytest import raises
from ...type import (
GraphQLDeprecatedDirective,
GraphQLIncludeDirective,
Expand Down
4 changes: 2 additions & 2 deletions graphql/validation/rules/overlapping_fields_can_be_merged.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def _find_conflicts_within_selection_set(
# selection set to collect conflicts within fragments spread together.
# This compares each item in the list of fragment names to every other item
# in that same list (except for itself).
for other_fragment_name in fragment_names[i + 1 :]:
for other_fragment_name in fragment_names[i + 1:]:
_collect_conflicts_between_fragments(
context,
conflicts,
Expand Down Expand Up @@ -444,7 +444,7 @@ def _collect_conflicts_within(
# (except to itself). If the list only has one item, nothing needs to
# be compared.
for i, field in enumerate(fields):
for other_field in fields[i + 1 :]:
for other_field in fields[i + 1:]:
# within one collection is never mutually exclusive
conflict = _find_conflict(
context,
Expand Down

0 comments on commit f3eabf7

Please sign in to comment.