Skip to content

Commit

Permalink
refactor and fix for mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
Kabir Khan committed Jun 30, 2023
1 parent ff3b55f commit 1999477
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions confection/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,10 +867,8 @@ def _fill(
field_type = EmptySchema
if key in schema.model_fields:
field = schema.model_fields[key]
field_type = field.annotation
if field_type is None or not _safe_is_subclass(field_type, BaseModel):
# If we don't have a pydantic schema and just a type
field_type = EmptySchema
if field.annotation is not None and _safe_is_subclass(field.annotation, BaseModel):
field_type = field.annotation
filled[key], validation[v_key], final[key] = cls._fill(
value,
field_type,
Expand Down

0 comments on commit 1999477

Please sign in to comment.