Skip to content

Conversation

@clbarnes
Copy link
Contributor

@clbarnes clbarnes commented Jul 11, 2023

Resolves #4

  • 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)

- 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)
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(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is worth noting

Copy link
Collaborator

Choose a reason for hiding this comment

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

good catch!

@d-v-b
Copy link
Collaborator

d-v-b commented Oct 27, 2023

@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 ArraySpec in dict form gets parsed as a GroupSpec, when it really shouldn't. Do you have any ideas for sorting this out? I don't think we can use Annotated here, or at least when I tried to use Annotated around a TypeVar used in generics I got some angry errors.

@d-v-b
Copy link
Collaborator

d-v-b commented Oct 27, 2023

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)

@d-v-b
Copy link
Collaborator

d-v-b commented Oct 27, 2023

I'm can't understand why this test is failing. Any ideas @clbarnes ?

@d-v-b d-v-b merged commit 882b7f1 into zarr-developers:main Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pydantic 2.0

2 participants