[SPARK-54944][PYTHON][TEST] Add tests for pa.Array.to_pandas with default arguments#55031
Open
zhengruifeng wants to merge 11 commits intoapache:masterfrom
Open
[SPARK-54944][PYTHON][TEST] Add tests for pa.Array.to_pandas with default arguments#55031zhengruifeng wants to merge 11 commits intoapache:masterfrom
zhengruifeng wants to merge 11 commits intoapache:masterfrom
Conversation
… with default args Add test_pyarrow_arrow_to_pandas_default.py to monitor PyArrow's to_pandas() behavior across all major Arrow types with golden file comparison, ensuring PySpark's assumptions remain valid across versions. Co-authored-by: Isaac
Co-authored-by: Isaac
Add list<list>, list<struct>, list<map>, struct<struct>, struct<list>, struct<map>, map with list/struct/map values to cover deep nesting. Co-authored-by: Isaac
Co-authored-by: Isaac
Move compare_or_generate_golden_matrix back to test files instead of the shared mixin. Add repr_pandas_series_value to GoldenFileTestMixin so repr_value handles pd.Series, removing the need for a custom _repr_result. Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
HyukjinKwon
approved these changes
Mar 26, 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.
What changes were proposed in this pull request?
Add
test_pyarrow_arrow_to_pandas_default.pyto monitor PyArrow'spa.Array.to_pandas()behavior with default arguments across all major Arrow types, using golden file comparison.Why are the changes needed?
PySpark relies on specific
to_pandas()conversion behaviors. This test captures the current behavior in a golden file so that any changes in future PyArrow upgrades are detected automatically.Does this PR introduce any user-facing change?
No. Test-only change.
How was this patch tested?
PyArrowArrayToPandasDefaultTestscovering 122 cases:golden_pyarrow_arrow_to_pandas_default.csvrecords expected resultsrepr_pandas_series_valuetoGoldenFileTestMixinfor properpd.Seriesformatting inrepr_valuemodules.pyWas this patch authored or co-authored using generative AI tooling?
Yes.