Skip to content

Pydantic: update divisions to match data & fix constraints#450

Open
Adam Lastowka (Rachmanin0xFF) wants to merge 5 commits intodevfrom
fix/divisions-and-constraint-updates
Open

Pydantic: update divisions to match data & fix constraints#450
Adam Lastowka (Rachmanin0xFF) wants to merge 5 commits intodevfrom
fix/divisions-and-constraint-updates

Conversation

@Rachmanin0xFF
Copy link
Contributor

@Rachmanin0xFF Adam Lastowka (Rachmanin0xFF) commented Feb 25, 2026

A couple small updates to Pydantic that are in my Parquet validation branch

Description

  • Widen AdminLevel from uint8 to int32 to match actual division data
  • Fix ModelConstraint.decorate validator dispatch: replace bound method with a closure to prevent Pydantic from rebinding self to the model instance

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Just to confirm — the json files in tests are autogenerated, correct?

Should we be excluding these generally and generating them within actions or something else?

@mojodna
Copy link
Collaborator

Just to confirm — the json files in tests are autogenerated, correct?

Yes, but only on demand (typically in response to changes made to the schema and compared to the previous version tracked by git to ensure that the differences are expected).

Should we be excluding these generally and generating them within actions or something else?

IMO, in their current form they should be checked in. Whether this mechanism should exist at all is a different matter; rather than testing the JSON Schema, we may want to consider a different mechanism to check the behavior of individual Pydantic models (I don't know what this would look like).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants