Skip to content

Commit

Permalink
avoid type error
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Jan 22, 2025
1 parent 34d28b3 commit de1f002
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rio_tiler/io/xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@

try:
import xarray
from xarray import open_dataset
except ImportError: # pragma: nocover
xarray = None # type: ignore
open_dataset = None # type: ignore

try:
import rioxarray
Expand Down Expand Up @@ -644,7 +646,7 @@ class DatasetReader(BaseReader):

tms: TileMatrixSet = attr.ib(default=WEB_MERCATOR_TMS)

opener: Callable[..., xarray.Dataset] = attr.ib(default=xarray.open_dataset)
opener: Callable[..., xarray.Dataset] = attr.ib(default=open_dataset)
opener_options: Dict = attr.ib(factory=dict)

_ctx_stack: contextlib.ExitStack = attr.ib(init=False, factory=contextlib.ExitStack)
Expand Down

0 comments on commit de1f002

Please sign in to comment.