Skip to content

Commit

Permalink
Fix edge case validation
Browse files Browse the repository at this point in the history
  • Loading branch information
lazebnyi committed Dec 3, 2024
1 parent 520998a commit 807d23e
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,10 @@ def _replace_type_if_not_valid(self, field_type: str) -> str:
"""
Replaces a field type if it matches a type mapping in `types_map`.
"""
for types_pair in self.schema_type_identifier.types_map:
if field_type == types_pair.current_type:
return types_pair.target_type
if self.schema_type_identifier.types_map:
for types_pair in self.schema_type_identifier.types_map:
if field_type == types_pair.current_type:
return types_pair.target_type
return field_type

@staticmethod
Expand All @@ -187,6 +188,7 @@ def _make_field_nullable(
"""

if is_nullable:
field_type = deepcopy(field_type)
field_type["type"] = ["null", field_type["type"]]
return field_type

Expand Down

0 comments on commit 807d23e

Please sign in to comment.