Skip to content

[SPARK-55821][PYTHON] Enforce keyword-only arguments in serializer __init__ methods#54605

Open
Yicong-Huang wants to merge 3 commits intoapache:masterfrom
Yicong-Huang:SPARK-55821/refactor/keyword-only-serializer-init
Open

[SPARK-55821][PYTHON] Enforce keyword-only arguments in serializer __init__ methods#54605
Yicong-Huang wants to merge 3 commits intoapache:masterfrom
Yicong-Huang:SPARK-55821/refactor/keyword-only-serializer-init

Conversation

@Yicong-Huang
Copy link
Contributor

@Yicong-Huang Yicong-Huang commented Mar 3, 2026

What changes were proposed in this pull request?

Add * separator to enforce keyword-only arguments in all serializer __init__ methods in pyspark.sql.pandas.serializers, and convert all call sites in worker.py from positional to keyword arguments.

Why are the changes needed?

As noted by @zhengruifeng in #54568 (comment), serializer constructors accept too many positional arguments, making call sites error-prone and hard to read. Enforcing keyword-only arguments prevents positional mistakes and improves readability.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Existing tests.

Was this patch authored or co-authored using generative AI tooling?

No.

Copy link
Contributor

@devin-petersohn devin-petersohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants