Skip to content

[v3] support for datetime and timedelta dtypes #2616

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

Open
jhamman opened this issue Jan 2, 2025 · 4 comments
Open

[v3] support for datetime and timedelta dtypes #2616

jhamman opened this issue Jan 2, 2025 · 4 comments
Milestone

Comments

@jhamman
Copy link
Member

jhamman commented Jan 2, 2025

Zarr-Python 2 supported datetime and timedelta dtypes. This functionality has not made it into Zarr-Python 3 yet (in part because the v3 spec does not have established extension dtypes for these yet).

Example of the behavior for Zarr 2:

z = zarr.array(['2007-07-13', '2006-01-13', '2010-08-13'], dtype='M8[D]')
z
<zarr.core.Array (3,) datetime64[D]>
z[:]
array(['2007-07-13', '2006-01-13', '2010-08-13'], dtype='datetime64[D]')
z[0]
numpy.datetime64('2007-07-13')
z[0] = '1999-12-31'
z[:]
array(['1999-12-31', '2006-01-13', '2010-08-13'], dtype='datetime64[D]')

This issue tracks the development of datetime and timedelta support in Zarr-Python 3.

@jhamman jhamman added this to the After 3.0.0 milestone Jan 2, 2025
@jhamman jhamman moved this to Todo in Zarr-Python - 3.0 Jan 10, 2025
RJ-Vestrum pushed a commit to RJ-Vestrum/zarr-python that referenced this issue Mar 3, 2025
    * 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
RJ-Vestrum pushed a commit to RJ-Vestrum/zarr-python that referenced this issue Mar 3, 2025
    * 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 pushed a commit to RJ-Vestrum/zarr-python that referenced this issue Mar 3, 2025
    * 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
@christine-e-smit
Copy link
Contributor

Hey Joe! All our zarr stores use the datetime type for our time dimension variable. It sounds like we'll have to transform all our zarr stores or help you make the change to support this data. What kind of effort do you think would be required for relative newbies to add datetime data type support to zarr v3?

@jhamman
Copy link
Member Author

jhamman commented Mar 17, 2025

#2874 should be merged in the next week or so and will include support for datetime dtypes.

@christine-e-smit
Copy link
Contributor

Oh I'm sorry. My eyes went right over the links in this ticket for some reason. Thank you.

@christine-e-smit
Copy link
Contributor

We are now actively in the process of updating our code. It looks as though #2874 has not been merged. Any idea on the ETA? Do we need to delay our migration?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants