Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions datamint/entities/base_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ def __getattr__(self, name: str) -> Any:
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")

if name not in pydantic_fields:
# Not a declared field - fall back to pydantic's extra fields (extra='allow')
pydantic_extra = object.__getattribute__(self, '__pydantic_extra__')
if pydantic_extra is not None and name in pydantic_extra:
return pydantic_extra[name]
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")

# This is a declared field that was deleted (MISSING_FIELD sentinel).
Expand Down
Loading