Hyukjin Kwon created SPARK-61006:
------------------------------------
Summary: Pass the named arguments of Python UDF and UDTF calls of
the Python client as PySpark does
Key: SPARK-61006
URL: https://issues.apache.org/jira/browse/SPARK-61006
Project: Spark
Issue Type: Bug
Components: Connect
Affects Versions: connect-rust-4.3.0
Reporter: Hyukjin Kwon
In PySpark Connect, a call of a Python UDF or UDTF takes keyword arguments:
{{UserDefinedFunction.__call__(*args, **kwargs)}} and
{{UserDefinedTableFunction.__call__(*args, **kwargs)}} send each keyword
argument as a {{NamedArgumentExpression}}, so that {{plus(a=lit(1),
b=col("x"))}} calls {{plus}} with {{a}} and {{b}}, and its column is
{{Column<'plus(a => 1, b => x)'>}}.
The Rust-backed Python client drops the keyword arguments of a UDF call, so the
call fails on the server with a {{PythonException}} of the missing arguments,
and its column is {{Column<'plus()'>}}; and a UDTF call with keyword arguments
raises {{TypeError}}. Pass the named arguments as PySpark does.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]