james-willis opened a new pull request, #1212: URL: https://github.com/apache/sedona-db/pull/1212
Follow-up to #1203, implementing @paleolimbot's post-merge suggestion there: 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 (passed explicitly so the anchor and the fixture can't drift apart), and the per-band nodata. 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). - 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]
