You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Nick Miller (Jira)" <ji...@apache.org> on 2024/07/25 21:02:00 UTC

[jira] [Created] (SPARK-49008) Propagate function signature in `DataFrame(...).transform(...)`

Nick Miller created SPARK-49008:
-----------------------------------

             Summary: Propagate function signature in `DataFrame(...).transform(...)`
                 Key: SPARK-49008
                 URL: https://issues.apache.org/jira/browse/SPARK-49008
             Project: Spark
          Issue Type: Improvement
          Components: PySpark
    Affects Versions: 3.5.3
            Reporter: Nick Miller


Propagating the function signature for `func` in `DataFrame(...).transform(...)` would enable type checkers like `mypy` to enforce that `func` is being correctly called through `DataFrame(...).transform(...)`.

 

`ParamSpec` seems like a suitable approach for this:
{code:python}
def transform(
    self,
    func: Callable[Concatenate["DataFrame", P], "DataFrame"],
    *args: P.args,
    **kwargs: P.kwargs,
) -> "DataFrame":
    ...
{code}



--
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