funrollloops opened a new pull request, #60362:
URL: https://github.com/apache/spark/pull/60362
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR:
https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g.,
'[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a
faster review.
7. If you want to add a new configuration, please read the guideline first
for naming configurations in
'common/utils/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the
guideline first in
'common/utils/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
Print a complete, repo-relative unified diff for each changed DataFrame
golden file before comparing its expected outputs. Each case runs once; diff
generation and comparison reuse its captured outputs.
A diff alone does not fail a test. `SPARK_GENERATE_GOLDEN_FILES=1` still
controls in-place regeneration, and `regenerate.sh` is unchanged.
### Why are the changes needed?
Verification currently stops at the first mismatched section. Seeing the
remaining changes requires a separate regeneration run. Printing the full patch
makes failures easier to diagnose and lets developers apply updates from test
logs without rerunning Spark.
### Does this PR introduce _any_ user-facing change?
No. This changes only the internal test framework.
### How was this patch tested?
Both suites passed on Zulu 21.0.12 and Python 3.12.13: 46 framework tests
and 8 Spark-backed tests, with no skips or golden-file changes.
```bash
build/sbt -Phive package
python/run-tests --parallelism=2 --testnames \
pyspark.sql.tests.df_golden.test_df_golden_framework,pyspark.sql.tests.df_golden.test_df_golden
dev/lint-python --ruff
```
Added coverage for passing cases that emit diffs, complete diffs after a
mismatch, regeneration without rerunning scripts, and files without a trailing
newline. Repository lint and formatting checks passed.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Isaac (Claude Code 2.1.322)
This pull request and its description were written by Isaac.
--
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]