feat(python/sedonadb): normalize geometry WKT expected values in harness#845
Open
oglego wants to merge 1 commit into
Open
feat(python/sedonadb): normalize geometry WKT expected values in harness#845oglego wants to merge 1 commit into
oglego wants to merge 1 commit into
Conversation
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.
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
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.pypytest -q python/sedonadb/tests/functions/test_functions.py