You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2026/04/29 13:28:19 UTC
[PR] [PYTHON][TESTS] Drop legacy `(object)` base from PySpark test mixins [spark]
zhengruifeng opened a new pull request, #55608:
URL: https://github.com/apache/spark/pull/55608
### What changes were proposed in this pull request?
Three PySpark test mixin classes still inherit explicitly from `object`:
- `python/pyspark/sql/tests/test_udf.py` — `BaseUDFTestsMixin(object)`
- `python/pyspark/sql/tests/test_resources.py` — `ResourceProfileTestsMixin(object)`
- `python/pyspark/sql/tests/arrow/test_arrow_map.py` — `MapInArrowTestsMixin(object)`
This PR drops the explicit `(object)` base, matching the modern `class Foo:` form used by the other ~50 mixin classes in `pyspark.sql.tests`.
### Why are the changes needed?
`class Foo(object):` is a Python 2 idiom required to opt into new-style classes. Under Python 3 — which is the only version Spark supports — every class implicitly inherits from `object`, so the `(object)` base is dead code. Three mixins still carry the legacy form while the rest of the test suite has standardized on the modern form; aligning them keeps the codebase consistent and removes a small piece of cargo-culted boilerplate that occasionally gets copied into new mixins.
### Does this PR introduce _any_ user-facing change?
No. Test-only change with no behavioral impact.
### How was this patch tested?
Existing tests. `class Foo(object):` and `class Foo:` produce identical classes under Python 3 (same MRO, same `__bases__`, same `isinstance` results).
### 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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [MINOR][PYTHON][TESTS] Drop legacy `(object)` base from PySpark test mixins [spark]
Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #55608:
URL: https://github.com/apache/spark/pull/55608#issuecomment-4348606170
merged to master
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [MINOR][PYTHON][TESTS] Drop legacy `(object)` base from PySpark test mixins [spark]
Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #55608: [MINOR][PYTHON][TESTS] Drop legacy `(object)` base from PySpark test mixins
URL: https://github.com/apache/spark/pull/55608
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org