You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GeoTIFF reader: upgrade non-finite/fractional int nodata from silent no-op to typed rejection (#1774 follow-up) #2441
When a GeoTIFF's GDAL_NODATA tag holds a non-finite string ("NaN", "Inf", "-Inf") or a fractional value ("3.5") on an integer-dtype file, the reader silently skips the masking step, preserves the dtype, and puts the raw sentinel on attrs['nodata']. #1774 introduced that no-op to stop the crash from int(float('nan')), but the silent skip is itself a problem: a caller downstream of open_geotiff cannot tell the difference between "no sentinel was declared" and "sentinel was declared and the reader ignored it". Pixels the caller expected to see as NaN are still raw integer values.
The geotiff release contract pins this in xrspatial/geotiff/tests/release_gates/test_stable_features.py::test_release_gate_negative_integer_nodata_float_promoted (currently xfailed). The contract says the reader should upgrade the no-op to a typed GeoTIFFAmbiguousMetadataError so the silent-coercion risk surfaces at the read boundary.
Expected behavior
Reading an integer GeoTIFF whose GDAL_NODATA tag is non-finite or fractional raises GeoTIFFAmbiguousMetadataError by default. The message names nodata and points at an allow_invalid_nodata=True opt-in that preserves the existing no-op behavior for callers whose files legitimately carry such sentinels.
Tracking
Flips the test_release_gate_negative_integer_nodata_float_promoted xfail to a pass.
Updates the test_nodata_nan_int_1774.py regression suite to use the new opt-in.
Activity
Address PR review: opt-in for VRT writer, dask+cupy rejection test (#…
Reject non-finite/fractional int GDAL_NODATA on read (#2441) (#2442)