Skip to content

[SEDONA-725] restructure spark python package#1930

Merged
jiayuasu merged 6 commits into
masterfrom
SEDONA-725-restructure-spark-python-package
May 3, 2025
Merged

[SEDONA-725] restructure spark python package#1930
jiayuasu merged 6 commits into
masterfrom
SEDONA-725-restructure-spark-python-package

Conversation

@Imbruced

Copy link
Copy Markdown
Member

Did you read the Contributor Guide?

  • Yes

Is this PR related to a ticket?

SEDONA-725

What changes were proposed in this PR?

restructure spark python package

How was this patch tested?

existing unit tests

Did this PR include necessary documentation updates?

yes

@Imbruced

Copy link
Copy Markdown
Member Author

@jiayuasu this is the spark part

@Imbruced Imbruced marked this pull request as ready for review April 29, 2025 20:44
@Imbruced Imbruced requested a review from jiayuasu as a code owner April 29, 2025 20:44
import warnings

warnings.warn(
"The 'sedona.spark.stats.clustering.dbscan' module is deprecated and will be removed in future versions. Please use 'sedona.spark.stats' instead.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"The 'sedona.spark.stats.clustering.dbscan' module is deprecated and will be removed in future versions. Please use 'sedona.spark.stats' instead.",
"The 'sedona.stats.clustering.dbscan' module is deprecated and will be removed in future versions. Please use 'sedona.spark.stats' instead.",

import warnings

warnings.warn(
"The 'sedona.utils.structured_adapter' module is deprecated and will be removed in future versions. Please use 'sedona.spark' instead.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"The 'sedona.utils.structured_adapter' module is deprecated and will be removed in future versions. Please use 'sedona.spark' instead.",
"The 'sedona.utils.structured_adapter' module is deprecated and will be removed in future versions. Please use 'sedona.spark.utils' instead.",

# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from sedona.spark.stac.client import Client

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please keep the Apache file header unless you completely drop the file

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

This PR restructures the Spark Python package in Sedona by updating import paths from sedona.core modules to sedona.spark modules and reorganizing the package structure.

  • Updated import statements across core, SQL, and utility modules
  • Refactored documentation and notebooks to reflect new module paths
  • Added error handling for PySpark availability in the spark init.py

Reviewed Changes

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

Show a summary per file
File Description
python/sedona/spark/core/SpatialRDD/linestring_rdd.py Updated import paths and references to use new sedona.spark modules.
python/sedona/spark/core/SpatialRDD/circle_rdd.py Updated import paths; potential bug in getCenterLineStringRDDAsSpatialRDD method call.
python/sedona/spark/init.py Updated import paths and added PySpark availability check.
python/sedona/spark/SedonaContext.py Adjusted imports to the new package structure.
docs/* Updated documentation and notebooks to use sedona.spark endpoints.
Comments suppressed due to low confidence (1)

python/sedona/spark/core/SpatialRDD/circle_rdd.py:53

  • In the getCenterLineStringRDDAsSpatialRDD method, the call to 'getCenterPolygonAsSpatialRDD()' should likely be updated to 'getCenterLineStringRDDAsSpatialRDD()' to correctly match the method's intent.
srdd = self._srdd.getCenterPolygonAsSpatialRDD()

@Imbruced Imbruced requested a review from jbampton as a code owner May 1, 2025 19:43
@github-actions github-actions Bot added the root label May 1, 2025
@Imbruced

Imbruced commented May 1, 2025

Copy link
Copy Markdown
Member Author

@jiayuasu great catch, I added auto-generating license for Python files in pre-commit (I always forget to add them)

@Imbruced Imbruced force-pushed the SEDONA-725-restructure-spark-python-package branch from 0f91602 to e3143fc Compare May 1, 2025 19:55
@jiayuasu jiayuasu added this to the sedona-1.8.0 milestone May 3, 2025
@jiayuasu jiayuasu changed the title Sedona 725 restructure spark python package [SEDONA-725] restructure spark python package May 3, 2025
@jiayuasu jiayuasu merged commit ca9ca30 into master May 3, 2025
@jiayuasu jiayuasu deleted the SEDONA-725-restructure-spark-python-package branch May 30, 2025 15:57
james-willis added a commit to james-willis/sedona that referenced this pull request Jul 25, 2025
mostly these are just adding "redirects" to the new location.

the geoarrow I moved out of the util folder. unless we had never released this at the time, this seemed to just be a mistake that failed to maintain backwards compatability.

I skipped some things because I thought maybe theyre not supported APIS:
* everything in core
* sedona.register outside of what is available from the init file

I'm sure I missed some things here but hopefull this makes things a lot better for existing users of sedona.
james-willis added a commit to james-willis/sedona that referenced this pull request Jul 28, 2025
mostly these are just adding "redirects" to the new location.

the geoarrow I moved out of the util folder. unless we had never released this at the time, this seemed to just be a mistake that failed to maintain backwards compatability.

I skipped some things because I thought maybe theyre not supported APIS:
* everything in core
* sedona.register outside of what is available from the init file

I'm sure I missed some things here but hopefull this makes things a lot better for existing users of sedona.
jiayuasu pushed a commit that referenced this pull request Jul 29, 2025
* SedonaUtils fix

* maintain backwards compat from the restructuring in #1930

mostly these are just adding "redirects" to the new location.

the geoarrow I moved out of the util folder. unless we had never released this at the time, this seemed to just be a mistake that failed to maintain backwards compatability.

I skipped some things because I thought maybe theyre not supported APIS:
* everything in core
* sedona.register outside of what is available from the init file

I'm sure I missed some things here but hopefull this makes things a lot better for existing users of sedona.

* PR Comments + remove SedonaMapUtils.py, its not a public interface.

* revert test style changes

* clean up imports

* remove print statements

* fix tests

* Fix raster UDT import order issue

---------

Co-authored-by: Kristin Cowalcijk <bo@wherobots.com>
Kontinuation pushed a commit to Kontinuation/sedona that referenced this pull request Jan 21, 2026
…) (apache#452)

## Did you read the Contributor Guide?

- Yes, I have read the [Contributor
Rules](https://sedona.apache.org/latest/community/rule/) and
[Contributor Development
Guide](https://sedona.apache.org/latest/community/develop/)

- No, I haven't read it.

## Is this PR related to a ticket?

- Yes, and the PR name follows the format `[SEDONA-XXX] my subject`.
- Yes, and the PR name follows the format `[GH-XXX] my subject`.

- No:
- this is a documentation update. The PR name follows the format `[DOCS]
my subject`
- this is a CI update. The PR name follows the format `[CI] my subject`

## What changes were proposed in this PR?


## How was this patch tested?


## Did this PR include necessary documentation updates?

- Yes, I am adding a new API. I am using the [current SNAPSHOT version
number](https://github.com/apache/sedona/blob/99239524f17389fc4ae9548ea88756f8ea538bb9/pom.xml#L29)
in `vX.Y.Z` format.
- Yes, I have updated the documentation.
- No, this PR does not affect any public API so no need to change the
documentation.

Co-authored-by: Paweł Tokaj <pawel93kocinski@gmail.com>
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.

3 participants