pedrumj2 opened a new pull request, #58878:
URL: https://github.com/apache/spark/pull/58878
### What changes were proposed in this pull request?
Refactors test assertions into protected methods.
### Why are the changes needed?
Some downstream consumers such as Apache Gluten reuse these test to ensure
spark functionality is tested on changes. In apache/gluten#12976 after the
velox map_from_arrays operator was enabled, the Exception asserted in some
spark tests changed (while core logic remained the same). This required either:
- Disabling the test --> losing test coverage
- Copying the entire test --> Duplicating code
By making the assertion protected, downstream consumers can override the
limited lines without having to copy the entire test body allowing better
re-usability downstream.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
```
build/mvn -pl sql/core -am test -Dtest=none -DfailIfNoTests=false \
-DwildcardSuites=org.apache.spark.sql.RuntimeNullChecksV2Writes,org.apache.spark.sql.DataFrameFunctionsSuite
RuntimeNullChecksV2Writes:
...
DataFrameFunctionsSuite:
...
Run completed in 50 seconds, 854 milliseconds.
Total number of tests run: 176
Suites: completed 4, aborted 0
Tests: succeeded 176, failed 0, canceled 0, ignored 0, pending 0
All tests passed.
[INFO] BUILD SUCCESS
```
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Co-authored with Claude Code (Opus 5)
--
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]