Skip to content

[GH-3329] Preserve WKB dimensions in Arrow export - #3332

Closed
ryux1 wants to merge 1 commit into
apache:masterfrom
ryux1:fix/all-empty-geometrycollection-arrow
Closed

[GH-3329] Preserve WKB dimensions in Arrow export#3332
ryux1 wants to merge 1 commit into
apache:masterfrom
ryux1:fix/all-empty-geometrycollection-arrow

Conversation

@ryux1

@ryux1 ryux1 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Did you read the Contributor Guide?

The applicable contributor rules and Python development instructions were checked during delegated preparation.

Is this PR related to a ticket?

Yes. Closes #3329.

What changes were proposed in this PR?

For WKB encoding, collect the canonical output of GeoSeries.to_wkb() before delegating Arrow construction to GeoPandas. This avoids a GeometryType-to-Python round trip that can infer a Z dimension for a 2D GeometryCollection whose typed members are all empty. Native GeoArrow encoding continues to use the existing path.

The shared parity fixture now includes GeometryCollection([Point(), LineString(), Polygon()]), reproducing the case removed from #3326 and verifying that Sedona matches GeoPandas.

How was this patch tested?

  • Python 3.9 with PySpark 3.5 and the Sedona 1.9.0 shaded JAR
  • TestMatchGeopandasSeries::test_to_arrow
  • TestMatchGeopandasSeries::test_to_wkb
  • TestGeoSeries::test_to_arrow
  • all configured pre-commit hooks for both changed files
  • Python bytecode compilation and git diff --check

Did this PR include necessary documentation updates?

No. This fixes serialization behavior without changing the public API.

@jiayuasu

jiayuasu commented Sep 8, 2026

Copy link
Copy Markdown
Member

Thanks for creating this PR. the correct fix should be in this PR #3335

@ryux1

ryux1 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for pointing me to #3335. I checked the two approaches, and #3335 fixes the dimension loss in the shared decoder rather than special-casing WKB export, with broader empty LineString and GEOS-version coverage. It fully supersedes this narrower change, so I’m closing this PR in favor of it.

@ryux1 ryux1 closed this Sep 9, 2026
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.

GeoSeries.to_arrow differs for all-empty GeometryCollection members

2 participants