From 6269ae9e3948d72cb03656e8a9df0ed6b6f31ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20M=C3=BChlbauer?= Date: Fri, 20 Sep 2024 07:57:33 +0200 Subject: [PATCH] attempt to fix typing --- xarray/backends/netCDF4_.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xarray/backends/netCDF4_.py b/xarray/backends/netCDF4_.py index 1dd3d7909fe..32f6abeb611 100644 --- a/xarray/backends/netCDF4_.py +++ b/xarray/backends/netCDF4_.py @@ -42,6 +42,9 @@ if TYPE_CHECKING: from io import BufferedIOBase + from h5netcdf.core import EnumType as h5EnumType + from netCDF4 import EnumType as ncEnumType + from xarray.backends.common import AbstractDataStore from xarray.core.dataset import Dataset from xarray.core.datatree import DataTree @@ -319,7 +322,7 @@ def _is_list_of_strings(value) -> bool: def _build_and_get_enum( store, var_name: str, dtype: np.dtype, enum_name: str, enum_dict: dict[str, int] -) -> Any: +) -> ncEnumType | h5EnumType: """ Add or get the netCDF4 Enum based on the dtype in encoding. The return type should be ``netCDF4.EnumType``,