-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
support for datetime and timedelta dtypes (#2616) #2884
base: main
Are you sure you want to change the base?
support for datetime and timedelta dtypes (#2616) #2884
Conversation
* Add support for the datetime dtypes * Add support for the timedelta dtypes * Add test to validate the fill_values for for datetime * Add test to validate the fill_values for for timedelta * Add towncrier file for changes
@RJ-Vestrum thanks so much for this work! We definitely want to have these datatypes in zarr, but there are few complications:
IMO this is a lot clearer than using a stringly-typed identifier like A second complication for your work is my current effort to completely refactor how dtypes work in zarr-python (see #2874). In that PR, I'm unifying v2 and v3 data type handling via a completely new set of python objects to model dtypes. If you're interested, I'd love to get your feedback / input on that work, because I haven't added datetimes or timedeltas yet. I'd be happy to explain how you could add those under the proposed framework in that PR if you're interested. Otherwise, there's a risk that the work in this PR would need to be re-done in the new framework, provided #2874 is successful. Since there's so many moving parts right now (spec changes, multiple PRs), we should probably invest some effort in coordinating our efforts. let me know if you're interested! |
@d-v-b thanks for the detailed response and for explaining all the moving parts here! I really appreciate the context on both the spec changes and the dtype refactor in #2874. This PR was mostly a workaround I had been using locally, and I wanted to share it in case it could contribute to the development process. I don’t have much time to coordinate right now, but I’ll take a look at #2874 and keep it in mind. I’m planning to revisit this in April, so if #2874 is finalized by mid-April, I can rework this PR to align with the new framework then. I also fully agree that specifying data types in metadata rather than using stringly-typed identifiers will make things much clearer. Thanks again for taking the time to lay this all out! |
I'm curious...how specific is the on-disk storage of |
great question, I have no idea, but if the answer is "yes", then it's even more reason to think about an arrow-style dtype hierarchy where primitive types form the basis of logical types. |
My first contribution addressing #2616!
Summary of changes:
* Add support for the datetime dtypes
* Add support for the timedelta dtypes
* Update tests to validate the fill_values for for datetime and timedelta
* Towncrier file for changes
TODO:
docs/user-guide/*.rst
changes/