Skip to content

Commit 59837ef

Browse files
author
Rami Chowdhury
committed
Reformat
1 parent 7984e6c commit 59837ef

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

graphene_pydantic/converters.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,15 @@ def convert_pydantic_field(
138138
if field_type is None:
139139
raise ValueError("No field type could be determined.")
140140

141-
resolver_function = getattr(parent_type,
142-
"resolve_" + field.name,
143-
None)
141+
resolver_function = getattr(parent_type, "resolve_" + field.name, None)
144142
if resolver_function and callable(resolver_function):
145143
field_resolver = resolver_function
146144
else:
147145
field_resolver = get_attr_resolver(field.name)
148146

149147
return Field(field_type, resolver=field_resolver, **field_kwargs)
150148

149+
151150
def convert_pydantic_type(
152151
type_: T.Type,
153152
field: ModelField,
@@ -293,19 +292,15 @@ def convert_generic_python_type(
293292
return convert_literal_type(
294293
type_, field, registry, parent_type=parent_type, model=model
295294
)
296-
elif (
297-
origin
298-
in (
299-
T.Tuple,
300-
T.List,
301-
T.Set,
302-
T.Collection,
303-
T.Iterable,
304-
list,
305-
set,
306-
)
307-
or issubclass(origin, collections.abc.Sequence)
308-
):
295+
elif origin in (
296+
T.Tuple,
297+
T.List,
298+
T.Set,
299+
T.Collection,
300+
T.Iterable,
301+
list,
302+
set,
303+
) or issubclass(origin, collections.abc.Sequence):
309304
# TODO: find a better way of divining that the origin is sequence-like
310305
inner_types = getattr(type_, "__args__", [])
311306
if not inner_types: # pragma: no cover # this really should be impossible

0 commit comments

Comments
 (0)