james-willis opened a new pull request, #1218:
URL: https://github.com/apache/sedona-db/pull/1218

   **Stacked on #1211** (its branch lives on a fork, so the base can't be 
retargeted onto it — its commits are merged in instead; this diff deduplicates 
when #1211 lands. Merge #1211 first.)
   
   Implements @paleolimbot's post-merge suggestion on #1203: an optional 
parameter on `compare()` that lets the reference value be specified, guarding 
the parity claim against vacuous agreement — every engine returning the same 
wrong thing passes a pure engine-vs-engine comparison.
   
   ### The API
   
   ```python
   compare(sql, sedona, spark, expected=200.0)        # table path: anything 
assert_result accepts
   compare(sql, sedona, spark, expected=[(None,)])    # e.g. anchoring a NULL
   compare(sql, sedona, spark, expected=decoded)      # raster path: a 
DecodedRaster
   ```
   
   `expected` is keyword-only and optional. The subject is asserted against the 
anchor first (clearest failure when all engines agree on a wrong value), then 
against each reference as before — so the references are anchored transitively. 
Parity-only remains the default for cases where the reference is hard to state.
   
   ### Coverage added
   
   Anchors on every test whose expected value is trivially known:
   
   - `test_rs_band_nodata`: the written nodata for both bands, and `[(None,)]` 
for the no-nodata fixture.
   - All four passing setter tests (`test_rs_setbandnodata`, `_band2`, 
`_overwrite`, `_two_arg_single_band`): the full `DecodedRaster` — the exact 
seeded pixels (reconstructible because `random_raster_data` is seeded), the 
grid (stated explicitly so the anchor and the fixture can't drift apart), and 
the per-band nodata.
   
   The anchored tests place their grid with `bbox=`, and the anchors state the 
same BBOX via `DecodedRaster`'s bbox construction (added to #1211) — the 
instance still carries the derived `gdal_transform`, which is what 
`assert_decoded_equal` compares.
   
   The setter anchors close a real hole: with parity only, both engines 
no-opping identically (source nodata unchanged) would have passed every setter 
test.
   
   ### Verification
   
   - Suite: `21 passed, 13 xfailed` locally (pyspark 4.0.4, Sedona 1.9.1), plus 
#1211's `test_raster_testing.py` (26 passed) in-branch.
   - Negative-tested both paths: a wrong scalar anchor and a wrong 
raster-nodata anchor each raise `AssertionError`; the correct anchors pass.
   
   This suite is not yet wired into CI (#1206 does that), so the counts above 
are from a local run.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to