diff --git a/graphql/backend/base.py b/graphql/backend/base.py index 16dd76b4..36be85bf 100644 --- a/graphql/backend/base.py +++ b/graphql/backend/base.py @@ -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 diff --git a/graphql/language/lexer.py b/graphql/language/lexer.py index a60bc6e2..a017dbce 100644 --- a/graphql/language/lexer.py +++ b/graphql/language/lexer.py @@ -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 @@ -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] ), ) diff --git a/graphql/pyutils/compat.py b/graphql/pyutils/compat.py index 0012f20b..43613d74 100644 --- a/graphql/pyutils/compat.py +++ b/graphql/pyutils/compat.py @@ -240,4 +240,3 @@ def check_threads(): '(Enable the "enable-threads" flag).' ) ) - diff --git a/graphql/type/definition.py b/graphql/type/definition.py index 9099242e..ce9dffb5 100644 --- a/graphql/type/definition.py +++ b/graphql/type/definition.py @@ -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 @@ -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( diff --git a/graphql/type/tests/test_enum_type.py b/graphql/type/tests/test_enum_type.py index 6779db9c..989fac82 100644 --- a/graphql/type/tests/test_enum_type.py +++ b/graphql/type/tests/test_enum_type.py @@ -1,5 +1,5 @@ from collections import OrderedDict - +from rx import Observable from graphql import graphql from graphql.type import ( GraphQLArgument, diff --git a/graphql/utils/tests/test_build_ast_schema.py b/graphql/utils/tests/test_build_ast_schema.py index 2080331c..9ac12c2f 100644 --- a/graphql/utils/tests/test_build_ast_schema.py +++ b/graphql/utils/tests/test_build_ast_schema.py @@ -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, diff --git a/graphql/validation/rules/overlapping_fields_can_be_merged.py b/graphql/validation/rules/overlapping_fields_can_be_merged.py index 8506e2cd..4cba7ca2 100644 --- a/graphql/validation/rules/overlapping_fields_can_be_merged.py +++ b/graphql/validation/rules/overlapping_fields_can_be_merged.py @@ -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, @@ -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,