[SPARK-58332][PYTHON][TEST] Move compare_or_generate_golden_matrix into GoldenFileTestMixin#57510
Open
Spenserrrr wants to merge 1 commit into
Open
[SPARK-58332][PYTHON][TEST] Move compare_or_generate_golden_matrix into GoldenFileTestMixin#57510Spenserrrr wants to merge 1 commit into
Spenserrrr wants to merge 1 commit into
Conversation
…to GoldenFileTestMixin ### What changes were proposed in this pull request? `compare_or_generate_golden_matrix` was duplicated verbatim across three PyArrow golden-file test files. This moves it into `GoldenFileTestMixin` (`python/pyspark/testing/goldenutils.py`), which all three suites already inherit, and removes the local copies. ### Why are the changes needed? Removes duplicated test machinery so the golden-file matrix driver has a single implementation, following up on review feedback in apache#57435. ### Does this PR introduce _any_ user-facing change? No. Test-only, behavior-preserving refactor. ### How was this patch tested? Existing suites pass in compare mode (no golden files regenerated): test_pyarrow_array_cast, test_pyarrow_arrow_to_pandas_default, test_pyarrow_arrow_to_pandas_non_default. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.8) Co-authored-by: Isaac
Spenserrrr
marked this pull request as ready for review
July 24, 2026 20:10
Contributor
Author
|
Hi @Yicong-Huang and @uros-b! This is the follow-up to #57435 that removes the duplicated |
uros-b
approved these changes
Jul 24, 2026
Member
|
Thank you @Spenserrrr! cc @Yicong-Huang |
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?
compare_or_generate_golden_matrixwas duplicated verbatim across three PyArrow golden-file test files:python/pyspark/tests/upstream/pyarrow/test_pyarrow_array_cast.pypython/pyspark/tests/upstream/pyarrow/test_pyarrow_arrow_to_pandas_default.pypython/pyspark/tests/upstream/pyarrow/test_pyarrow_arrow_to_pandas_non_default.pyThis PR moves it into
GoldenFileTestMixin(python/pyspark/testing/goldenutils.py), which all three suites already inherit, and removes the local copies. Imports that became unused after the removal (inspect,os,typing.Callable/List/Optional) are dropped from the test files.This is a follow-up to #57435, where reviewers asked to centralize the duplicated matrix driver into the mixin.
Why are the changes needed?
Removes duplicated test machinery so the golden-file matrix driver has a single implementation, making it easier to maintain and reuse for future golden-file suites.
Does this PR introduce any user-facing change?
No. Test-only, behavior-preserving refactor.
How was this patch tested?
Existing suites pass in compare mode (no golden files regenerated):
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8)