geotiff: reject open_geotiff(max_cloud_bytes=...) on gpu/dask/VRT paths (#1974)#1989
Merged
Conversation
…hs (#1974) max_cloud_bytes was only consumed on the eager non-VRT branch. The GPU, dask, and VRT branches accepted the kwarg at the signature but never forwarded it, so callers got a silent budget drop. Add an up-front ValueError guard mirroring the on_gpu_failure (#1810) and missing_sources (#1810) rejection pattern. Flip the four xfail pins in test_max_cloud_bytes_dispatcher_silent_drop_2026_05_15.py to passing tests and remove TestCurrentSilentDropPins. Add three sentinel-default regressions so the guard cannot fire on calls that omit the kwarg.
…ics (#1974) Address PR #1989 review: * Update the ``max_cloud_bytes`` docstring on ``open_geotiff`` to mention that passing the kwarg with ``gpu=True``, ``chunks=...``, or a ``.vrt`` source raises ValueError. The sibling kwargs ``on_gpu_failure`` and ``missing_sources`` already document their rejection conditions; this brings the third one in line. * Add three test pins covering ``max_cloud_bytes=None`` on the GPU, dask, and VRT branches. ``None`` is the documented "skip the budget check" value on the eager path, but the sentinel-based guard treats it as "caller supplied a value" and rejects it -- matching how ``on_gpu_failure`` / ``missing_sources`` handle explicit values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1974.
Summary
open_geotiffacceptedmax_cloud_bytesin its signature but only forwarded it on the eager non-VRT branch. The GPU branch, the dask branch, and the VRT branch dropped the kwarg without warning, so callers had no way to learn that the budget was being ignored.This matches the dispatcher silent-drop class fixed in #1561, #1605, #1685, and #1810. The two sibling kwargs
on_gpu_failureandmissing_sourcesalready raiseValueErrorup front; this PR adds the same guard formax_cloud_bytes.Change
In
xrspatial/geotiff/__init__.py, after the existingon_gpu_failureandmissing_sourcesrejection blocks, rejectmax_cloud_byteswhen:.vrtfile (VRT branch),gpu=True(GPU branch), orchunks is not None(dask branch).The GPU check fires before the chunks check, so the
gpu=True + chunks=N(dask+cupy) combination is covered without needing cupy installed for the error path.Tests
xrspatial/geotiff/tests/test_max_cloud_bytes_dispatcher_silent_drop_2026_05_15.py:xfail(strict=True)tests pinned by geotiff: pin open_geotiff(max_cloud_bytes=...) dispatcher silent drop (#1974) #1977 are now plain passing tests.TestCurrentSilentDropPinsis removed (its purpose was to make the before/after diff observable; the new rejection tests serve that role).Test plan
pytest xrspatial/geotiff/tests/test_max_cloud_bytes_dispatcher_silent_drop_2026_05_15.py-- 11 passedpytest xrspatial/geotiff/tests/ -k "max_cloud_bytes or dispatcher or open_geotiff"-- 275 passedValueError; default-kwarg calls on each path still succeed