Skip to content

geotiff: fix CI regression where int-coord no-georef writes hit fail-closed guard#1968

Closed
brendancol wants to merge 1 commit into
xarray-contrib:mainfrom
brendancol:fix-ci-int-coords-require-transform
Closed

geotiff: fix CI regression where int-coord no-georef writes hit fail-closed guard#1968
brendancol wants to merge 1 commit into
xarray-contrib:mainfrom
brendancol:fix-ci-int-coords-require-transform

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

CI on main has been red since the back-to-back merges of #1953 (preserve transform on 1xN / Nx1 georeferenced writes) and #1954 (keep no-georef int coords through to_geotiff round-trip).

The interaction breaks any read -> write round-trip of a non-georef TIFF: coords_to_transform correctly returns None on the int coords, then the fail-closed guard sees coords present + no transform and raises ValueError("Cannot infer GeoTIFF transform...").

Eleven previously-passing tests started failing on the merge of #1959:

  • test_features.py::TestExtraTags::test_extra_tags_round_trip
  • test_georef_edges.py::TestNonGeoreferencedRead::test_round_trip_preserves_pixels
  • test_metadata_round_trip_1484.py (3 tests)
  • test_vrt_int_nodata_1564.py (6 tests)

The fix mirrors the int-dtype short-circuit from coords_to_transform inside require_transform_for_georeferenced: when both spatial coord arrays are integer-dtype, treat that as the no-georef sentinel and return without raising. Float-coord 1x1 inputs still trip the guard, which is what #1945 was actually targeting.

Test plan

…oref sentinel

PR xarray-contrib#1945 added require_transform_for_georeferenced to fail closed when
a DataArray carries spatial coords but no transform could be derived.
PR xarray-contrib#1949 (merged the same day) made coords_to_transform return None for
integer-dtype coords because those are the read-side no-georef sentinel
that open_geotiff emits for files without GeoTIFF tags.

The combination breaks any round-trip that reads a non-georef TIFF and
writes it back: coords_to_transform returns None on the int coords,
then require_transform_for_georeferenced raises ValueError.

Mirror the int-dtype short-circuit in the fail-closed guard so the
sentinel path stays silent and only float-coord 1x1 inputs trip the
error.
@github-actions
Copy link
Copy Markdown

Hi @brendancol, thanks for the PR!

Would you mind filing a quick New contributor introduction issue when you get a chance? It helps us point you at issues that fit what you'd like to work on. Most fields are optional.

Reviewing your PR doesn't depend on it, just a friendly nudge.

@github-actions github-actions Bot added the performance PR touches performance-sensitive code label May 15, 2026
@brendancol brendancol closed this May 15, 2026
@brendancol
Copy link
Copy Markdown
Contributor Author

Closed — superseded by #1969, which was merged with the same int-coord short-circuit plus a clearer error message and a regression test. Rebasing this branch onto current main leaves an empty diff, so nothing left to merge here.

brendancol added a commit that referenced this pull request May 15, 2026
…1970)

The previous gate skipped maintainers via
github.event.pull_request.author_association. On PR #1968 that field
came through as something other than MEMBER for a maintainer's
cross-fork PR (brendancol, admin permission), so the welcome workflow
greeted them as a first-time contributor.

The same field has misreported same-repo maintainer PRs in the past;
copilot-review.yml already gates around it via head.repo == base.repo.
Apply the equivalent here and add a runtime collaborator-permission
lookup so cross-fork PRs from maintainers' personal forks are also
skipped.

The default GITHUB_TOKEN has read access to the collaborator-permission
endpoint on the repo where the workflow runs, so the call works without
additional secrets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant