[SPARK-52785][PYTHON] Simplifying super() syntax in PySpark#54790
[SPARK-52785][PYTHON] Simplifying super() syntax in PySpark#54790simolanayak wants to merge 3 commits intoapache:masterfrom
Conversation
…les _globals.py, sql/connect/plan.py sql/pandas/serializers.py sql/tests/test_udf.py streaming/tests/test_listener.py. 7 instances.
|
@simolanayak Can we keep the PR title short (e.g., SPARK-52785: Simplify super() usage in PySpark) and move the file list / ‘N instances’ details into the What changes were proposed section? The current title is a bit long. |
huaxingao
left a comment
There was a problem hiding this comment.
LGTM! Thanks @simolanayak for your contribution!
|
Most of the changes in this PR are incorrect (semantics equivalent wise). I did this once and fixed most of the Basically class A(B):
def f(self):
# equivalent to
# super(A, self).f()
# but NOT
# super(B, self).f()
super().f()So we can only change the ones that explicitly use the classes the methods are defined in (not their base class). I believe at least a few of them are super intentional to skip the methods of one of the parent classes. That being said, there are a few of the changes are correct. So we should keep those. |
…tests fail: serializers.py, test_udf.py, test_listener.py
|
I believe the ones in serializers should be reverted too. |
|
Let's also keep the PR description updated: |
What changes were proposed in this pull request?
9 instances of super(Class, cls) syntax removed and simplified to super()
These are present in the files:
Why are the changes needed?
Issue SPARK-52785
Remove Python 2 support
Does this PR introduce any user-facing change?
No behavior changes
How was this patch tested?
github actions
Was this patch authored or co-authored using generative AI tooling?
No