Skip to content

test(rust/sedona-raster-functions): Add multi-band regression tests for RS_* raster functions#747

Merged
paleolimbot merged 4 commits into
apache:mainfrom
james-willis:jw/nd-raster-regression-tests
Apr 2, 2026
Merged

test(rust/sedona-raster-functions): Add multi-band regression tests for RS_* raster functions#747
paleolimbot merged 4 commits into
apache:mainfrom
james-willis:jw/nd-raster-regression-tests

Conversation

@james-willis
Copy link
Copy Markdown
Contributor

@james-willis james-willis commented Mar 31, 2026

Summary

  • Adds generate_multi_band_raster() helper to sedona-testing — 3-band raster with heterogeneous types (UInt8/UInt16/Float32) and different nodata values
  • Adds multi-band tests to existing test modules:
    • rs_numbands: verifies band count = 3
    • rs_band_accessors: verifies RS_BandPixelType and RS_BandNoDataValue return correct per-band values across heterogeneous bands

Pre-work for the N-Dimensional Raster Type Extension. The migration will replace the raster Arrow schema, traits, builder, and reader — these tests cover gaps in multi-band coverage so behavioral changes are caught.

Test plan

  • cargo test -p sedona-raster-functions — 143 tests pass (140 existing + 3 new)
  • cargo test -p sedona-testing test_generate_multi_band — round-trip test passes
  • cargo clippy — no new warnings

@github-actions github-actions Bot requested a review from paleolimbot March 31, 2026 22:33
Comment thread rust/sedona-raster-functions/src/lib.rs Outdated
Lock in behavioral contracts for all 33 RS_* functions before the
N-D raster type migration. These tests verify exact outputs so that
any schema/trait changes that alter observable behavior will be
caught immediately.
Move regression tests from src/regression_tests.rs to
tests/regression_tests.rs per review feedback. Fix clippy
warnings and formatting.
@james-willis james-willis force-pushed the jw/nd-raster-regression-tests branch from 3cd2df7 to cde0edb Compare April 1, 2026 17:49
Replace standalone regression_tests.rs with targeted tests in the
modules where gaps existed:

- sedona-testing: add generate_multi_band_raster() helper (3 bands:
  UInt8/UInt16/Float32 with different nodata) and round-trip test
- rs_numbands: add multi-band test verifying count=3
- rs_band_accessors: add multi-band tests for RS_BandPixelType and
  RS_BandNoDataValue verifying per-band heterogeneous types and nodata
@james-willis james-willis changed the title test: add regression tests for RS_* raster functions test: add multi-band regression tests for RS_* raster functions Apr 1, 2026
@james-willis james-willis marked this pull request as ready for review April 1, 2026 18:35
@james-willis james-willis requested a review from paleolimbot April 1, 2026 18:35
Copy link
Copy Markdown
Member

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

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

Thank you!

There's one CI fix needed (cargo clippy --fix should do it, or you can configure an editor like VSCOde to use cargo clippy as the linting command). Hopefully CI will run automatically for you after this merges.

@paleolimbot paleolimbot changed the title test: add multi-band regression tests for RS_* raster functions test(rust/sedona-raster-functions): Add multi-band regression tests for RS_* raster functions Apr 2, 2026
@paleolimbot paleolimbot merged commit c9b72a0 into apache:main Apr 2, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants