Skip to content

geotiff: skip degenerate streaming tests when tifffile is unavailable#1926

Merged
brendancol merged 1 commit into
mainfrom
ci-fix-tifffile-importorskip-1912
May 15, 2026
Merged

geotiff: skip degenerate streaming tests when tifffile is unavailable#1926
brendancol merged 1 commit into
mainfrom
ci-fix-tifffile-importorskip-1912

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

CI on main has been failing since #1912 (commit 15882e6) landed. The new file test_dask_streaming_write_degenerate_2026_05_15.py uses a _read_raw_pixels helper that does a bare import tifffile. tifffile is an optional dependency that is not installed in the CI environment, so three tests that call the helper error out with ModuleNotFoundError instead of skipping:

  • TestStreamingWriteAllNan::test_all_nan_with_sentinel
  • TestStreamingWriteAllNan::test_all_nan_default_nodata
  • TestStreamingWriteMixedNanInf::test_mixed_nan_plus_minus_inf

Other tests in the repo handle the same situation with pytest.importorskip("tifffile") (e.g. test_dask_max_pixels_default_guard_1838.py, test_backend_pixel_parity_matrix_1813.py, test_predictor2_int8.py). This change applies the same pattern in the helper so the three tests skip when tifffile is missing and still run when it is installed.

Failed run: https://github.com/xarray-contrib/xarray-spatial/actions/runs/25921856318

Test plan

  • Run the file locally with tifffile installed: all 16 tests pass.
  • Run the file locally with tifffile blocked via a meta_path shim: 13 pass, 3 skip (previously 3 errored).
  • CI pytest job goes green on this PR.

The dask streaming degenerate-shape tests added in #1912 use a
_read_raw_pixels helper that does a bare ``import tifffile`` to verify
on-disk encoding. ``tifffile`` is an optional CI dependency, so when it
is not installed the three tests that call this helper error out with
ModuleNotFoundError instead of skipping. CI on main has been failing
since 15882e6 landed.

Other tests in the repo handle this with pytest.importorskip; this
change applies the same pattern so the three tests skip cleanly when
tifffile is missing.
Copilot AI review requested due to automatic review settings May 15, 2026 14:21
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label May 15, 2026
@brendancol brendancol merged commit eb66cf4 into main May 15, 2026
13 of 14 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes CI failures introduced by PR #1912 by replacing a bare import tifffile in a test helper with pytest.importorskip, so tests that depend on the optional tifffile dependency skip cleanly rather than erroring with ModuleNotFoundError.

Changes:

  • Use pytest.importorskip("tifffile") inside the _read_raw_pixels helper, matching the pattern already used elsewhere in the test suite.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants