feat(rust/sedona-testing): add ergonomic raster function test harness#945
Open
james-willis wants to merge 7 commits into
Open
feat(rust/sedona-testing): add ergonomic raster function test harness#945james-willis wants to merge 7 commits into
james-willis wants to merge 7 commits into
Conversation
Adds RasterSpec, a terse declarative raster fixture (the raster analog of WKT for geometry tests), plus tester and assertion plumbing: - RasterSpec::d2/nd with band/band_values/band_nd/nodata/name/outdb modifiers, sequential default pixel fill, and a PixelValue trait for typed pixel data (little-endian) - raster_array() for multi-row inputs with null rasters - ScalarUdfTester::invoke_raster_scalar/invoke_raster_array/ invoke_raster_array_scalar and a raster Literal path through scalar_lit - AggregateUdfTester::aggregate_rasters for future raster aggregates - Raster-aware assert_scalar_equal/assert_array_equal (null rows compared by validity, mismatches reported per-field instead of a struct dump) - list_utf8_row/list_i64_row/band_pixels extractors for common return shapes - Retrofit rs_bandpath and rs_band_accessors tests as demos - Parameterized end-to-end Python tests for RS_ functions over a Zarr fixture, with a gated probe documenting that the Zarr byte loader is not yet reachable from RS_EnsureLoaded in Python
paleolimbot
reviewed
Jun 12, 2026
paleolimbot
left a comment
Member
There was a problem hiding this comment.
This is great, thanks for working on it! Feel free to ignore any of this if you're still working through changes
Comment on lines
+221
to
+226
| /// Override the GDAL geotransform | ||
| /// `[origin_x, scale_x, skew_x, origin_y, skew_y, scale_y]`. | ||
| pub fn transform(mut self, transform: [f64; 6]) -> Self { | ||
| self.transform = transform; | ||
| self | ||
| } |
Member
There was a problem hiding this comment.
No need to do this here, but Wwhen we get to some more spatial interactions, setting this from a BoundingBox might also be nice
Contributor
Author
There was a problem hiding this comment.
I'm adding some logics this week to build transforms from bboxes to support spatial:bbox attributes as a way to georeference datasets.
…zarr-reader tests to sedonadb-zarr The sedonadb-package raster function tests used a Zarr fixture, forcing a zarr/sedonadb_zarr dependency. Switch them to an in-DB RS_Example() raster so they run without zarr, and relocate the zarr-reader-specific RS tests (per-chunk transform, fill_value->nodata, RS_BandPath chunk anchor, RS_EnsureLoaded) plus their fixtures to the sedonadb-zarr package.
…ollision Two test_raster_functions.py (sedonadb + sedonadb-zarr) collide under pytest's rootdir import mode (no package __init__.py). Rename the sedonadb-zarr one to test_zarr_raster_functions.py.
…in assert_raster_equal assert_raster_equal only checked width/height/geotransform and band metadata/bytes, so two rasters differing only in CRS, or with transposed N-D spatial dims, compared equal. Add asserts for crs(), spatial_dims(), spatial_shape(), and per-band dim_names()/shape(), plus a regression test that a CRS-only difference is now caught. Also surface a clear assertion (not a bare unwrap panic) when an in-db band is strided.
…aster test fixture The apache#940 extension-registration refactor renamed the Zarr ExternalFormatSpec from ZarrFormatSpec to Zarr; the relocated raster-function test fixture still referenced the old name and errored at setup.
sedonadb_zarr is the package under test in this suite, not an optional dependency, so import it directly rather than via importorskip — a missing or broken build should fail loudly, not silently skip. (zarr/numpy stay on importorskip; those are genuinely optional.)
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.
No description provided.