oglego opened a new pull request, #845:
URL: https://github.com/apache/sedona-db/pull/845
## Summary
Fixes #815 - formatting-only failures in Python tests that use WKT as an
expected value by normalizing geometry WKT in the Python test harness before
comparison.
## Problem
Some Python tests compare query results against expected WKT strings using
`assert_query_result()`. When the query returns a geometry value, the Python
harness converts that geometry to WKT before comparing tuple results.
The issue is that equivalent WKT can be formatted differently depending on
which writer produced it. In practice, this showed up as whitespace-only
differences, such as whether spaces appear after commas:
Expected:
`POLYGON Z ((0 0 5,0 1 5,1 1 5,1 0 5,0 0 5))`
Got:
`POLYGON Z ((0 0 5, 0 1 5, 1 1 5, 1 0 5, 0 0 5))`
These failures are not about the geometry result itself, they come from
string formatting differences.
## What changed
- Updated the Python test harness to canonicalize WKT only for
geometry-typed result columns during tuple-based comparisons
- Left non-geometry string columns on exact string comparison
- Added a regression test that verifies this distinction:
- geometry results with spacing-only WKT differences compare equal
- plain string results with the same spacing differences still fail
## Why this approach
This keeps geometry tests focused on geometry semantics rather than
renderer-specific text formatting.
The important detail is scope: we do not normalize all strings globally.
Only columns that are actually typed as geometry are canonicalized. That avoids
masking real regressions in plain-text outputs while still fixing the
formatting-only failures that motivated this change.
## Testing
- `pytest -q python/sedonadb/tests/test_testing.py`
- `pytest -q python/sedonadb/tests/functions/test_functions.py`
--
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]