Skip to content

Commit

Permalink
attempt to fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuehlbauer committed Sep 20, 2024
1 parent 9589c56 commit 6269ae9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xarray/backends/netCDF4_.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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``,
Expand Down

0 comments on commit 6269ae9

Please sign in to comment.