Skip to content

Commit

Permalink
fix #86
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasaarholt committed Oct 22, 2024
1 parent a854732 commit 6da1250
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/patito/_pydantic/dtypes/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def validate_annotation(
class DtypeResolver:
def __init__(self, annotation: Any | None):
self.annotation = annotation
self.schema = TypeAdapter(annotation).json_schema()
# mode='serialization' allows nested models with structs, see #86
self.schema = TypeAdapter(annotation).json_schema(mode="serialization")
self.defs = self.schema.get("$defs", {})

def valid_polars_dtypes(self) -> DataTypeGroup:
Expand Down

0 comments on commit 6da1250

Please sign in to comment.