[GH-3351][Python] Preserve generated GeoArrow column names - #3354
Merged
jiayuasu merged 1 commit intoSep 12, 2026
Conversation
Quote Spark column references before converting geometry fields to EWKB.
jiayuasu
approved these changes
Sep 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Did you read the Contributor Guide?
Yes, I have read the Contributor Rules and Contributor Development Guide.
Is this PR related to a ticket?
Yes. Closes #3351.
What changes were proposed in this PR?
dataframe_to_arrow()previously usedlist(df)to build its input expressions. Spark resolves a generated geometry name such asst_point(1.0, 2.0)as a dotted path, so conversion fails before GeoArrow encoding runs.Build explicit, backtick-quoted Spark column expressions from the schema names, escaping embedded backticks, before applying
ST_AsEWKB. The original field name is still restored withalias, so generated geometry expressions retain their expected Arrow column name.How was this patch tested?
SELECT ST_Point(1.0, 2.0)without an alias.AnalysisException; with this patch the input and Arrow table both reported['st_point(1.0, 2.0)']and one row.python/tests/utils/test_geoarrow.py: 7 passed, 1 optional GeoArrow-types test skipped.compileall, andgit diff --checkpassed.Did this PR include necessary documentation updates?
No documentation changes are needed. This restores conversion for an existing DataFrame shape without changing the public API.