-
Notifications
You must be signed in to change notification settings - Fork 5
Update to pydantic 2 #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Use new-fangled syntax - depend on typing-extensions for py<3.12 - Change error messages in doctests - Bump black, ruff dependencies for compatibility with pytest-examples - Add black and ruff to dev dependencies (fixed versions)
src/pydantic_zarr/core.py
Outdated
| fill_value=zarray.fill_value, | ||
| # explicitly cast to numpy type and back to python | ||
| # so that int 0 isn't serialized as 0.0 | ||
| fill_value=zarray.dtype.type(zarray.fill_value).tolist(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is worth noting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
… exposes problem with unions in pydantic
|
@clbarnes I pushed a lot of changes into this branch. perhaps the most important is the addition of this test which is currently failing. Pydantic 2 changed how it handles unions, and for some reason it's not doing the right thing here -- a |
|
OK, this was my mistake, and it's now fixed (by re-adding the "no extra fields" constraint on the base model for array and group specs) |
Resolves #4