Skip to content

Commit

Permalink
test: add inverse test
Browse files Browse the repository at this point in the history
  • Loading branch information
joscha committed Feb 10, 2025
1 parent 12db74e commit 0212eb0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/libs/test_pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,8 +748,10 @@ class MyModel(BaseModel):
def test_parent_nullable_means_children_nullable():
class MyParent(BaseModel):
optional_child: Optional[ChildModel]
non_optional_child: ChildModel
dlt_config: ClassVar[DltConfig] = {"skip_nested_types": True}

schema = pydantic_to_table_schema_columns(MyParent)

assert schema["optional_child__child_attribute"]["nullable"]
assert schema["non_optional_child__child_attribute"]["nullable"] is True

0 comments on commit 0212eb0

Please sign in to comment.