Spenserrrr opened a new pull request, #57510:
URL: https://github.com/apache/spark/pull/57510

   ### What changes were proposed in this pull request?
   
   `compare_or_generate_golden_matrix` was duplicated verbatim across three 
PyArrow golden-file test files:
   
   - `python/pyspark/tests/upstream/pyarrow/test_pyarrow_array_cast.py`
   - 
`python/pyspark/tests/upstream/pyarrow/test_pyarrow_arrow_to_pandas_default.py`
   - 
`python/pyspark/tests/upstream/pyarrow/test_pyarrow_arrow_to_pandas_non_default.py`
   
   This 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):
   
   ```
   python -m pytest \
     python/pyspark/tests/upstream/pyarrow/test_pyarrow_array_cast.py \
     
python/pyspark/tests/upstream/pyarrow/test_pyarrow_arrow_to_pandas_default.py \
     
python/pyspark/tests/upstream/pyarrow/test_pyarrow_arrow_to_pandas_non_default.py
   ```
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.8)


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to