Skip to content

Commit

Permalink
Change field_is_complex to be more similar to pydantic v1
Browse files Browse the repository at this point in the history
  • Loading branch information
dmontagu committed Apr 27, 2023
1 parent 9e384cc commit 1a62c7b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pydantic_settings/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def field_is_complex(self, field: FieldInfo) -> bool:
bool: Whether the field is complex.
"""
result = _annotation_is_complex(field.annotation)
print(result)
print(result, field.annotation)
return result

def prepare_field_value(self, field_name: str, field: FieldInfo, value: Any, value_is_complex: bool) -> Any:
Expand Down Expand Up @@ -446,8 +446,6 @@ def find_case_path(dir_path: Path, file_name: str, case_sensitive: bool) -> Opti

def _annotation_is_complex(annotation: type[Any] | None) -> bool:
origin = get_origin(annotation)
if origin_is_union(origin):
return all(_annotation_is_complex(arg) for arg in get_args(annotation))
return (
_annotation_is_complex_inner(annotation)
or _annotation_is_complex_inner(origin)
Expand Down

0 comments on commit 1a62c7b

Please sign in to comment.