Skip to content

Commit

Permalink
Fix nodata retrieval logic to ensure compatibility with rioxarray
Browse files Browse the repository at this point in the history
  • Loading branch information
lbferreira committed Dec 12, 2024
1 parent 796a99c commit fa4a84c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions odc/geo/_xr_interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,11 +1024,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, numpy._NoValue)
if nodata is numpy._NoValue:
nodata = encoding.get(k, numpy._NoValue)

if nodata == ():
if nodata is numpy._NoValue:
continue

if nodata is None:
Expand Down

0 comments on commit fa4a84c

Please sign in to comment.