Skip to content

Commit 6d7fbd1

Browse files
committed
refactor
1 parent 14b61f8 commit 6d7fbd1

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

fastapi_jsonapi/data_layers/filtering/sqlalchemy.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,19 @@ def _separate_types(self, types: List[Type]) -> Tuple[List[Type], List[Type]]:
122122
and some other built-in types. The second are all other types for which
123123
the `arbitrary_types_allowed` config is applied when defining the pydantic model
124124
"""
125-
pydantic_types = filter(lambda type_: type_ in REGISTERED_PYDANTIC_TYPES, types)
126-
userspace_types_types = filter(lambda type_: type_ not in REGISTERED_PYDANTIC_TYPES, types)
127-
return list(pydantic_types), list(userspace_types_types)
125+
pydantic_types = [
126+
# skip format
127+
type_
128+
for type_ in types
129+
if type_ in REGISTERED_PYDANTIC_TYPES
130+
]
131+
userspace_types = [
132+
# skip format
133+
type_
134+
for type_ in types
135+
if type_ not in REGISTERED_PYDANTIC_TYPES
136+
]
137+
return pydantic_types, userspace_types
128138

129139
def _cast_value_with_pydantic(
130140
self,

0 commit comments

Comments
 (0)