You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Yicong Huang (Jira)" <ji...@apache.org> on 2026/03/03 22:32:00 UTC
[jira] [Updated] (SPARK-55821) Enforce keyword-only arguments in serializer __init__ methods
[ https://issues.apache.org/jira/browse/SPARK-55821?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yicong Huang updated SPARK-55821:
---------------------------------
Summary: Enforce keyword-only arguments in serializer __init__ methods (was: [PYTHON] Enforce keyword-only arguments in serializer __init__ methods)
> Enforce keyword-only arguments in serializer __init__ methods
> -------------------------------------------------------------
>
> Key: SPARK-55821
> URL: https://issues.apache.org/jira/browse/SPARK-55821
> Project: Spark
> Issue Type: Improvement
> Components: PySpark
> Affects Versions: 4.0.0
> Reporter: Yicong Huang
> Priority: Minor
>
> The serializer classes in `pyspark.sql.pandas.serializers` accept many positional arguments in their `__init__` methods, making call sites error-prone and hard to read.
> For example, `ArrowStreamPandasUDFSerializer.__init__` takes 12 parameters, `ApplyInPandasWithStateSerializer.__init__` takes 7 parameters, etc. When these are called with positional arguments, it is very easy to mix up the order.
> We should enforce keyword-only arguments (using `*` separator after `self`) in serializer `__init__` methods to improve readability and prevent positional argument mistakes.
> All call sites in `worker.py` and within `serializers.py` (subclass `super().__init__` calls) must also be updated to use keyword arguments.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org