You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
np.dtypes.StringDType(na_object=None) doesn’t get preserved #3692
the zarr string data type does not express the na_object semantics, so I wouldn't expect na_object=NaN to work. We would need to add this to the spec, and even then I think composing string with the optional dtype is a better solution.
given that, what would you expect zarr python to do here?
given that, what would you expect zarr python to do here?
IMO we should error if na_object is set
Yeah, for example! Better than losing information and therefore corrupting data.
If there happens to be an unambiguous way to map between StringDType(na_object=…) and the new optional codec, transparently doing that would also be nice. We could define a special encoding for some common NA objects zarr-python recognizes (e.g. None, np.nan, pd.NA), but I get when that’s not something you want to do in zarr-python.
dynamic attributes, great stuff
I think that’s intentional in this case, as the fill value can be None. So instead of a sentinel object (which would be truthy or falsy and/or coerce to itself when compared with == like pandas.NA) they chose that, which needs to be be unambiguously checked with hasattr.
Activity
d-v-b commentedon Feb 7, 2026
the zarr string data type does not express the na_object semantics, so I wouldn't expect na_object=NaN to work. We would need to add this to the spec, and even then I think composing string with the optional dtype is a better solution.
given that, what would you expect zarr python to do here?
d-v-b commentedon Feb 7, 2026
IMO we should error if
na_objectis set:dynamic attributes, great stuff
flying-sheep commentedon Feb 7, 2026
Yeah, for example! Better than losing information and therefore corrupting data.
If there happens to be an unambiguous way to map between
StringDType(na_object=…)and the new optional codec, transparently doing that would also be nice. We could define a special encoding for some common NA objects zarr-python recognizes (e.g.None,np.nan,pd.NA), but I get when that’s not something you want to do in zarr-python.I think that’s intentional in this case, as the fill value can be
None. So instead of a sentinel object (which would be truthy or falsy and/or coerce to itself when compared with==likepandas.NA) they chose that, which needs to be be unambiguously checked withhasattr.