Skip to content

Conversation

maxrjones
Copy link
Contributor

This PR fixes an import issue with h5netcdf.core.EnumType. Recent Python versions require explicit submodule imports, so import h5netcdf followed by h5netcdf.core.EnumType fails because the core submodule isn't automatically loaded. This was causing pickling issues with NetCDF4 files (xref developmentseed/titiler-multidim#97).

(see also, zarr-developers/zarr-python#3473 for a bug caused by the same behavior)

@maxrjones
Copy link
Contributor Author

@kmuehlbauer would you be willing to provide some advice here? The min-deps CI check is failing because EnumType was only added in h5netcdf/h5netcdf#226 (released in v1.6.4), whereas https://github.com/pydata/xarray/blob/main/ci/requirements/min-all-deps.yml lists h5netcdf=1.3 as the oldest supported version. But, I think versions older than 1.6.4 wouldn't work with the h5netcdf backend since #9509 given the use of this new feature. I'm not sure if you'd rather add a workaround for older versions or bump the minimum supported version.

@kmuehlbauer
Copy link
Contributor

@maxrjones EnumType was released with h5netcdf 1.4.0 in October 2024.

@kmuehlbauer
Copy link
Contributor

This is also mentioned in a comment in the #9509 PR.

Maybe you need to conditionally import depending on version? I can have a closer look tomorrow.

@maxrjones
Copy link
Contributor Author

@maxrjones EnumType was released with h5netcdf 1.4.0 in October 2024.

ah, ok thanks for this clarification. It seems we're close, but not quite to the 12 month mark for minimum dependencies

@maxrjones maxrjones changed the title Import EnumType from h5netcdf.core directly Import h5netcdf.core to use EnumType Sep 23, 2025
Copy link
Contributor

@kmuehlbauer kmuehlbauer left a comment

Choose a reason for hiding this comment

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

Thanks @maxrjones , I've made a mental note, to not forget to remove this in October.

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

Successfully merging this pull request may close these issues.

2 participants