diff --git a/odc/geo/_xr_interop.py b/odc/geo/_xr_interop.py index 2ca3cb0f..4be83c07 100644 --- a/odc/geo/_xr_interop.py +++ b/odc/geo/_xr_interop.py @@ -50,7 +50,7 @@ ) from .overlap import compute_output_geobox from .roi import roi_is_empty -from .types import Nodata, Resolution, SomeNodata, SomeResolution, SomeShape, xy_ +from .types import Nodata, Resolution, SomeNodata, SomeResolution, SomeShape, Unset, xy_ # pylint: disable=import-outside-toplevel # pylint: disable=too-many-lines @@ -80,6 +80,8 @@ ("lat", "lon"), ] +_NoValue = Unset() + @dataclass class GeoState: @@ -1024,11 +1026,11 @@ def nodata(self) -> Nodata: encoding = self._xx.encoding for k in ["nodata", "_FillValue"]: - nodata = attrs.get(k, ()) - if nodata == (): - nodata = encoding.get(k, ()) + nodata = attrs.get(k, _NoValue) + if nodata is _NoValue: + nodata = encoding.get(k, _NoValue) - if nodata == (): + if nodata is _NoValue: continue if nodata is None: