You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "jiayuasu (via GitHub)" <gi...@apache.org> on 2026/09/11 07:18:46 UTC

[PR] [GH-3333] Handle leading nulls in local GeoSeries construction [sedona]

jiayuasu opened a new pull request, #3349:
URL: https://github.com/apache/sedona/pull/3349

   ## 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/).
   
   ## Is this PR related to a ticket?
   
   Closes #3333.
   
   ## What changes were proposed in this PR?
   
   On Spark 3.5, local input such as `GeoSeries([None, Point(1, 2)])` fails with `ArrowInvalid`: pandas-on-Spark checks the first value to infer the geometry type, so a leading null prevents it from recognizing later geometries.
   
   For local input that starts with a missing value and contains a geometry, normalize missing entries, encode the values as well-known binary (WKB) with embedded SRIDs, and construct the geometry column with `ST_GeomFromWKB`. Restore the original Series name after WKB conversion. This preserves input order, index, name, geometry dimensions, and existing CRS handling. Other constructor paths remain unchanged.
   
   ## How was this patch tested?
   
   The new tests produced 13 `ArrowInvalid` failures on the unchanged Spark 3.5 constructor, with three controls passing. A separate regression check caught both pandas and NumPy `NaT` values before missing-value normalization was added.
   
   31 focused GeoSeries constructor, conversion, and CRS tests passed on each of Spark 3.5.0 and 4.1.1. Coverage includes local list, tuple, NumPy, pandas, GeoPandas, and GeometryArray inputs; missing-value variants; duplicate MultiIndex order; names; inherited and explicit CRS; empty geometries; and embedded SRID/Z preservation.
   
   Current Python source was tested with cached JVM jars: released Sedona 1.9.1 for Spark 3.5 and a prior local 2.0.0-SNAPSHOT build for Spark 4.1. No fresh JVM rebuild was performed. Formatting and pre-commit checks passed.
   
   ## Did this PR include necessary documentation updates?
   
   No documentation changes are needed. This fixes an existing constructor path without changing the public API.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [GH-3333] Handle leading nulls in local GeoSeries construction [sedona]

Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu merged PR #3349:
URL: https://github.com/apache/sedona/pull/3349


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org