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

   ### What changes were proposed in this pull request?
   
   Seven concrete PySpark test classes declare the framework base class before 
the test mixin (e.g. `class X(ReusedSQLTestCase, XTestsMixin)`), while the rest 
of the codebase consistently puts the mixin first. This PR reorders the parent 
classes in those 7 files to follow the project convention (mixin first, base 
class last):
   
   - `python/pyspark/sql/tests/test_utils.py` — `UtilsTests`
   - `python/pyspark/sql/tests/test_errors.py` — `ErrorsTests`
   - `python/pyspark/sql/tests/test_functions.py` — `FunctionsTests`
   - `python/pyspark/sql/tests/pandas/test_pandas_map.py` — `MapInPandasTests`
   - `python/pyspark/sql/tests/connect/client/test_artifact.py` — 
`ArtifactTests`
   - `python/pyspark/sql/tests/connect/client/test_artifact_localcluster.py` — 
`LocalClusterArtifactTests`
   - `python/pyspark/sql/tests/connect/test_utils.py` — `ConnectUtilsTests`
   
   ### Why are the changes needed?
   
   Today none of the affected mixins override 
`setUp`/`tearDown`/`setUpClass`/`tearDownClass`, so MRO yields identical 
behavior whether the mixin or the framework class comes first. The 
inconsistency is a latent footgun: any future lifecycle override added to the 
mixin would be silently shadowed by the framework base class instead of taking 
precedence — a subtle bug that would only manifest at runtime in the affected 
suites.
   
   Standardizing the parent ordering across the ~50+ mixin-using test classes 
in `pyspark.sql.tests` makes the convention enforceable by inspection and 
prevents this class of bug.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. This is a test-only change with no behavioral impact today.
   
   ### How was this patch tested?
   
   Existing tests. The change is a parent-class reorder that does not affect 
MRO resolution for any currently overridden method.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.7)


-- 
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