Skip to content

[GH-2450] chore(geopandas): write sjoin match tests for dwithin() - #2466

Merged
jiayuasu merged 4 commits into
apache:masterfrom
bunnysocks:chore/sjoin-match-test
Jul 20, 2026
Merged

[GH-2450] chore(geopandas): write sjoin match tests for dwithin()#2466
jiayuasu merged 4 commits into
apache:masterfrom
bunnysocks:chore/sjoin-match-test

Conversation

@bunnysocks

Copy link
Copy Markdown
Contributor

Did you read the Contributor Guide?

Is this PR related to a ticket?

What changes were proposed in this PR?

This PR adds new tests to improve coverage for Sedona’s GeoPandas integration, specifically for the sjoin() function using the predicate="dwithin" parameter.

Key updates:

  • Added a new test module test_sjoin_match.py under sedona/python/tests/geopandas/.
  • Implemented comparisons between Sedona’s and GeoPandas’ sjoin() outputs for dwithin() predicate.
  • Covered edge cases including:
    • Varying distance thresholds (0.5, 0.05, etc.)
    • Empty and small-distance joins
    • Type and integrity checks on returned GeoDataFrames

These tests aim to ensure Sedona’s spatial join behavior matches GeoPandas’ expected results and help detect future regressions.

How was this patch tested?

  • Manually verified using pytest locally.
  • Confirmed that:
    • Both Sedona and GeoPandas return equivalent results for valid dwithin() joins.
    • Output GeoDataFrames contain consistent left/right ID pairs.
  • CI will re-verify via automated testing upon PR submission.

Did this PR include necessary documentation updates?

  • No, this PR does not affect any public API, so no documentation changes are required.

@bunnysocks
bunnysocks requested a review from jiayuasu as a code owner October 31, 2025 08:51
@petern48
petern48 self-requested a review November 1, 2025 03:53
Comment thread python/sedona/spark/geopandas/geodataframe.py
Comment thread python/tests/geopandas/test_sjoin_match.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds GeoPandas parity tests for Sedona’s sjoin() with predicate="dwithin" to strengthen regression coverage for distance-based joins in the GeoPandas integration test suite.

Changes:

  • Introduces a new test_sjoin_match.py module that compares Sedona vs GeoPandas sjoin(dwithin) results.
  • Adds parameterized coverage across multiple distance thresholds and a left-join unmatched-row preservation check.
  • Normalizes join outputs to compare row-pairs deterministically across implementations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread python/tests/geopandas/test_sjoin_match.py
Comment thread python/tests/geopandas/test_sjoin_match.py Outdated
@jiayuasu jiayuasu added this to the sedona-1.9.1 milestone Jul 20, 2026
@jiayuasu
jiayuasu merged commit fb47a80 into apache:master Jul 20, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(geopandas): Write sjoin match tests for dwithin()

4 participants