Skip to content

[GH-2830] Add python / scala tests and add SRID-preservation tests for geography functions#2870

Merged
jiayuasu merged 7 commits into
apache:masterfrom
zhangfengcdt:feature/geography.df.tests
May 3, 2026
Merged

[GH-2830] Add python / scala tests and add SRID-preservation tests for geography functions#2870
jiayuasu merged 7 commits into
apache:masterfrom
zhangfengcdt:feature/geography.df.tests

Conversation

@zhangfengcdt
Copy link
Copy Markdown
Member

Did you read the Contributor Guide?

Is this PR related to a ticket?

  • Yes, and the PR name follows the format [GH-XXX] my subject. Closes #<issue_number>

What changes were proposed in this PR?

This PR add the following tests for the st geography functions.

  • Python tests (remove placeholder)
  • Scala DF API gap-fill ST_GeogFromText + ST_GeogCollFromText + geography/FunctionsDataFrameAPITest
  • New SRID-preservation suite PreserveSRIDGeographySuite

How was this patch tested?

new tests should all pass

Did this PR include necessary documentation updates?

  • No, this PR does not affect any public API so no need to change the documentation.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds missing DataFrame API coverage for Geography in both Scala and Python, and introduces a new suite to ensure SRID is preserved across key Geography expression chains (including through InferredExpression).

Changes:

  • Added PreserveSRIDGeographySuite to validate SRID preservation for Geography→Geography, cross-type conversions, and wrapped scalar/predicate cases.
  • Expanded Scala Geography DataFrame API tests to cover additional functions/predicates and filled constructor gaps (ST_GeogFromText, ST_GeogCollFromText).
  • Implemented Python st_constructors wrappers for missing Geography constructors/conversions and replaced placeholder Python geography tests with real DataFrame API coverage.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
spark/common/src/test/scala/org/apache/sedona/sql/geography/PreserveSRIDGeographySuite.scala New SRID-preservation test suite for Geography expression chains and conversions.
spark/common/src/test/scala/org/apache/sedona/sql/geography/FunctionsDataFrameAPITest.scala Adds DataFrame API tests for geography functions and a predicate (ST_Intersects).
spark/common/src/test/scala/org/apache/sedona/sql/geography/ConstructorsDataFrameAPITest.scala Adds DataFrame API tests for ST_GeogFromText and ST_GeogCollFromText SRID handling.
python/tests/sql/test_geography.py Replaces placeholders with comprehensive Python wrapper/DataFrame API tests for geography constructors, functions, and predicates.
python/sedona/spark/sql/st_constructors.py Adds Python wrappers for missing Geography constructors and geometry↔geography conversion functions.

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

@zhangfengcdt zhangfengcdt marked this pull request as ready for review April 30, 2026 17:58
@zhangfengcdt zhangfengcdt requested a review from jiayuasu as a code owner April 30, 2026 17:58
@jiayuasu
Copy link
Copy Markdown
Member

jiayuasu commented May 1, 2026

We also have DataFrame APIs in Scala. Please add those as well

@zhangfengcdt zhangfengcdt changed the title [GH-2830] Add python wrappers and tests and add SRID-preservation tests for geography functions [GH-2830] Add python / scala tests and add SRID-preservation tests for geography functions May 3, 2026
@zhangfengcdt
Copy link
Copy Markdown
Member Author

We also have DataFrame APIs in Scala. Please add those as well

Sure, I have added the scala dataframe tests for these new st functions - spark/common/src/test/scala/org/apache/sedona/sql/geography/FunctionsDataFrameAPITest.scala

@jiayuasu jiayuasu added this to the sedona-1.9.1 milestone May 3, 2026
@jiayuasu jiayuasu merged commit cfc80d5 into apache:master May 3, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants