Uh oh!
There was an error while loading. Please reload this page.
[SPARK-55059][PYTHON] Remove empty table workaround in toPandas - #53824
Closed
Yicong-Huang wants to merge 1 commit into
Closed
[SPARK-55059][PYTHON] Remove empty table workaround in toPandas#53824Yicong-Huang wants to merge 1 commit into
Yicong-Huang wants to merge 1 commit into
Conversation
Yicong-Huang
marked this pull request as draft
January 15, 2026 23:30
JIRA Issue Information=== Improvement SPARK-55059 === This comment was automatically generated by GitHub Actions |
Yicong-Huangforce-pushed
the
SPARK-55059/refactor/remove-empty-table-workaround
branch
from
January 16, 2026 00:53
fa4f1a3 to
754c775CompareContributorAuthor
waiting for #53822 |
Yicong-Huangforce-pushed
the
SPARK-55059/refactor/remove-empty-table-workaround
branch
from
January 16, 2026 01:04
754c775 to
dc3371bCompareYicong-Huang
commented
Mar 16, 2026
ContributorAuthor
depends on #54820 |
Yicong-Huangforce-pushed
the
SPARK-55059/refactor/remove-empty-table-workaround
branch
from
March 18, 2026 20:25
6421453 to
af90c9cCompareYicong-Huang
marked this pull request as ready for review
March 18, 2026 20:26
Yicong-Huangforce-pushed
the
SPARK-55059/refactor/remove-empty-table-workaround
branch
from
March 19, 2026 00:43
af90c9c to
2acd216CompareYicong-Huang
commented
Mar 19, 2026
ContributorAuthor
cc @ueshin@HyukjinKwon@zhengruifeng this is ready for review. |
HyukjinKwon
approved these changes
Mar 19, 2026
HyukjinKwon
commented
Mar 19, 2026
Member
Merged to master. |
terana pushed a commit
to terana/spark
that referenced
this pull request
Mar 23, 2026
### What changes were proposed in this pull request? Remove the SPARK-51112 workaround in `_convert_arrow_table_to_pandas()` that bypassed PyArrow's `to_pandas()` for empty tables. ### Why are the changes needed? The workaround was added because arrow-java's `ListVector.getBufferSizeFor(0)` returned 0, causing the offset buffer to be omitted for empty nested arrays in IPC serialization, which led to a segmentation fault in PyArrow. This has been fixed upstream in arrow-java 19.0.0 ([apache/arrow-java#343](apache/arrow-java#343)), which Spark adopted in SPARK-56000 (PR apache#54820). The workaround is no longer necessary. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing test `test_to_pandas_for_empty_df_with_nested_array_columns` passes. ### Was this patch authored or co-authored using generative AI tooling? No. Closesapache#53824 from Yicong-Huang/SPARK-55059/refactor/remove-empty-table-workaround. Authored-by: Yicong Huang <17627829+Yicong-Huang@users.noreply.github.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
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 freeto 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.
What changes were proposed in this pull request?
Remove the SPARK-51112 workaround in
_convert_arrow_table_to_pandas()that bypassed PyArrow'sto_pandas()for empty tables.Why are the changes needed?
The workaround was added because arrow-java's
ListVector.getBufferSizeFor(0)returned 0, causing the offset buffer to be omitted for empty nested arrays in IPC serialization, which led to a segmentation fault in PyArrow.This has been fixed upstream in arrow-java 19.0.0 (apache/arrow-java#343), which Spark adopted in SPARK-56000 (PR #54820). The workaround is no longer necessary.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing test
test_to_pandas_for_empty_df_with_nested_array_columnspasses.Was this patch authored or co-authored using generative AI tooling?
No.