Skip to content

[GH-2007] Geopandas.Dataframe: Fix constructor for pandas-on-pyspark and Sedona Geopandas input types#2008

Merged
jiayuasu merged 8 commits into
apache:masterfrom
petern48:geodataframe_constructor
Jun 26, 2025
Merged

[GH-2007] Geopandas.Dataframe: Fix constructor for pandas-on-pyspark and Sedona Geopandas input types#2008
jiayuasu merged 8 commits into
apache:masterfrom
petern48:geodataframe_constructor

Conversation

@petern48

Copy link
Copy Markdown
Member

Did you read the Contributor Guide?

Is this PR related to a ticket?

What changes were proposed in this PR?

Fixed Geodataframe.__init__()'s behavior to properly handle Sedona Geopandas and pandas-on-pyspark input types.

Also made it so any column with geometry type is converted to wkb, instead of only gpd.GeoSeries

How was this patch tested?

Added tests

Did this PR include necessary documentation updates?

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

@petern48 petern48 requested a review from jiayuasu as a code owner June 25, 2025 22:08
@petern48 petern48 requested review from zhangfengcdt and removed request for jiayuasu June 25, 2025 22:08
@petern48 petern48 requested a review from jiayuasu June 25, 2025 23:34
@petern48

Copy link
Copy Markdown
Member Author

Whoops sorry Jia, I meant to request you for a different PR that already got approved. Too many prs and issues open.
Anyways, @zhangfengcdt Ready for review. Don't think there's as much to go back and forth here.

@zhangfengcdt zhangfengcdt left a comment

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.

Thanks for the fix, and it looks great to me!

@jiayuasu jiayuasu added this to the sedona-1.8.0 milestone Jun 26, 2025
@jiayuasu jiayuasu changed the title Geopandas.Dataframe: Fix constructor for pandas-on-pyspark and Sedona Geopandas input types [GH-2007] Geopandas.Dataframe: Fix constructor for pandas-on-pyspark and Sedona Geopandas input types Jun 26, 2025
@jiayuasu jiayuasu merged commit 70967cb into apache:master Jun 26, 2025
26 checks passed
Kontinuation pushed a commit to Kontinuation/sedona that referenced this pull request Jan 21, 2026
…spark and Sedona Geopandas input types (apache#2008)

* Fix small constructor bug

* Fix condition for converting to wkb

* Fix constructor to not error on sgpd and pspd inputs

* Add constructor tests for all input types, including non-geometry

* pre-commit reformat

* Change to BaseGeometry for shapely compatibilty

* pre-commit fmt

* Remove empty lst and dct test cases since diff spark versions handle differently
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.

Geopandas.Dataframe: Constructor is broken for pandas-on-pyspark and Sedona Geopandas input types

3 participants