Skip to content

Commit c88fb21

Browse files
committed
Fixed Flake8 issues
1 parent b3989ae commit c88fb21

File tree

6 files changed

+24
-13
lines changed

6 files changed

+24
-13
lines changed

graphql/backend/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import six
44

55

6-
76
class GraphQLBackend(six.with_metaclass(ABCMeta)):
87
@abstractmethod
98
def document_from_string(self, schema, request_string):
@@ -27,6 +26,6 @@ def get_operations(self):
2726
if definition.name:
2827
operation_name = definition.name.value
2928
else:
30-
operation_name = None
29+
operation_name = None
3130
operations[operation_name] = definition.operation
3231
return operations

graphql/backend/core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from ..language.base import parse, print_ast
66
from ..language import ast
77
from ..validation import validate
8-
from ..error import GraphQLError
98

109
from .base import GraphQLBackend, GraphQLDocument
1110

graphql/backend/decider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def document_from_string(self, schema, request_string):
1414
for backend in self.backends:
1515
try:
1616
return backend.document_from_string(schema, request_string)
17-
except Exception as e:
17+
except Exception:
1818
continue
1919

2020
raise Exception(

graphql/backend/quiver_cloud.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
try:
22
import requests
3-
except:
3+
except ImportError:
44
raise ImportError(
55
"requests package is required for Quiver Cloud backend.\n"
66
"You can install it using: pip install requests"
@@ -38,7 +38,7 @@ def __init__(self, dsn, python_options=None, **options):
3838
super(GraphQLQuiverCloudBackend, self).__init__(**options)
3939
try:
4040
url = urlparse(dsn.strip())
41-
except:
41+
except Exception:
4242
raise Exception("Received wrong url {}".format(dsn))
4343

4444
netloc = url.hostname
@@ -93,7 +93,10 @@ def document_from_string(self, schema, request_string):
9393
source = self.generate_source(schema, request_string)
9494
filename = "<document>"
9595
code = compile(source, filename, "exec")
96-
uptodate = lambda: True
96+
97+
def uptodate():
98+
return True
99+
97100
document = GraphQLCompiledDocument.from_code(
98101
schema, code, uptodate, self.extra_namespace
99102
)

graphql/execution/base.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def __eq__(self, other):
4040
)
4141

4242

43-
4443
class ResolveInfo(object):
4544
__slots__ = ('field_name', 'field_asts', 'return_type', 'parent_type',
4645
'schema', 'fragments', 'root_value', 'operation', 'variable_values', 'context', 'path')
@@ -58,3 +57,18 @@ def __init__(self, field_name, field_asts, return_type, parent_type,
5857
self.variable_values = variable_values
5958
self.context = context
6059
self.path = path
60+
61+
62+
__all__ = [
63+
'ExecutionResult',
64+
'ResolveInfo',
65+
'ExecutionContext',
66+
'SubscriberExecutionContext',
67+
'get_operation_root_type',
68+
'collect_fields',
69+
'should_include_node',
70+
'does_fragment_condition_match',
71+
'get_field_entry_key',
72+
'default_resolve_fn',
73+
'get_field_def',
74+
]

graphql/graphql.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
from .execution import ExecutionResult, execute
2-
from .language.ast import Document
3-
from .language.parser import parse
4-
from .language.source import Source
5-
from .validation import validate
1+
from .execution import ExecutionResult
62
from .backend import get_default_backend
73

84
from promise import promisify

0 commit comments

Comments
 (0)