geotiff: chunked-VRT coverage for missing_sources policy (#1799)#1959
Merged
brendancol merged 2 commits intoMay 15, 2026
Conversation
22d0aa1 to
80ec851
Compare
Contributor
Author
PR Review: geotiff: chunked-VRT coverage for missing_sources policy (#1799)Blockers (must fix before merge)
Suggestions (should fix, not blocking)
Nits (optional improvements)
What looks good
Checklist
|
brendancol
added a commit
to brendancol/xarray-spatial
that referenced
this pull request
May 15, 2026
f9c4511 to
a61436a
Compare
brendancol
added a commit
to brendancol/xarray-spatial
that referenced
this pull request
May 15, 2026
Contributor
Author
PR Review: geotiff: chunked-VRT coverage for missing_sources policy (#1799) (re-review after rebase)Blockers (must fix before merge)
Suggestions (should fix, not blocking)
Nits (optional improvements)
What looks good
Checklist
|
…rib#1799) The existing test_vrt_missing_sources_policy_1799 covers the eager read_vrt path but not the chunked path. The chunked path (_backends/vrt.py:_read_vrt_chunked) plumbs missing_sources through two separate code paths: - A parse-time static os.path.exists sweep at vrt.py:595-621 that populates attrs['vrt_holes'] at build time without forcing a compute (the contract documented in xarray-contrib#1734 for partial-mosaic detection on the lazy graph). - Per-chunk forwarding of missing_sources to _vrt_chunk_read so each task applies the same warn/raise policy as the eager path. A regression dropping the parse-time sweep would break partial-mosaic detection on the lazy build; a regression dropping the per-chunk forward would silently degrade missing_sources='raise' to 'warn' (or vice versa) on the chunked path. Adds 8 tests, all passing: - missing_sources='warn' populates vrt_holes at build + emits warning on compute + present-source chunk decodes correctly - chunks=(h, w) tuple form threads through identically - missing_sources='raise' fails at compute on chunks touching missing sources but succeeds on windowed compute that misses them - default missing_sources is 'raise' on the chunked path (parity with eager default flipped in xarray-contrib#1843 / xarray-contrib#1860) - invalid policy raises ValueError at build, parity with eager path Mutation against attrs['vrt_holes'] population at vrt.py:620-621 flipped the two build-time tests red.
Contributor
Author
|
Rebased onto current main at |
a61436a to
7085ee8
Compare
4 tasks
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.
Summary
Closes a Cat 1 MEDIUM cross-backend equivalence gap for issue #1799 (VRT
missing_sourcespolicy).test_vrt_missing_sources_policy_1799.pycovers the eagerread_vrtpath but not the chunked path.The chunked path (
_backends/vrt.py:_read_vrt_chunked) plumbsmissing_sourcesthrough two separate code paths:os.path.existssweep atvrt.py:595-621that populatesattrs['vrt_holes']at build time without forcing a compute (the contract documented in geotiff: read_vrt default lenient mode hides source read failures as zero-filled holes #1734 for partial-mosaic detection on the lazy graph).missing_sourcesto_vrt_chunk_readso each task applies the same warn/raise policy as the eager path.A regression dropping the parse-time sweep would break partial-mosaic detection on the lazy build; a regression dropping the per-chunk forward would silently flip
missing_sources='raise'to'warn'(or vice versa) on the chunked path.8 new tests, all passing:
missing_sources='warn'populatesvrt_holesat build + emits warning on compute + present-source chunk decodes correctlychunks=(h, w)tuple form threads through identicallymissing_sources='raise'fails at compute on chunks touching missing sources but succeeds on windowed compute that misses themmissing_sourceson the chunked path is'raise'(parity with eager default flipped in VRT missing_sources default before stable release #1843 / geotiff: read_vrt and open_geotiff(.vrt) default missing_sources to lenient 'warn' #1860)ValueErrorat build, parity with eager pathMutation against the
attrs['vrt_holes']population atvrt.py:620-621flipped the two build-time tests red.This is a deep-sweep test-coverage PR. No source files were modified.
Test plan
pytest xrspatial/geotiff/tests/test_vrt_chunked_missing_sources_1799.py(8 passed)pytest xrspatial/geotiff/tests/test_vrt_chunked_missing_sources_1799.py xrspatial/geotiff/tests/test_vrt_missing_sources_policy_1799.py(11 passed)attrs['vrt_holes'] = chunked_holesat vrt.py:620 -> 2 build-time tests fail