Skip to content

Commit

Permalink
[SPARK-48228][PYTHON][CONNECT][FOLLOWUP] Also apply `_validate_pandas…
Browse files Browse the repository at this point in the history
…_udf` in MapInXXX

### What changes were proposed in this pull request?
Also apply `_validate_pandas_udf`  in MapInXXX

### Why are the changes needed?
to make sure validation in `pandas_udf` is also applied in MapInXXX

### Does this PR introduce _any_ user-facing change?
no

### How was this patch tested?
ci

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

Closes apache#46524 from zhengruifeng/missing_check_map_in_xxx.

Authored-by: Ruifeng Zheng <[email protected]>
Signed-off-by: Ruifeng Zheng <[email protected]>
  • Loading branch information
zhengruifeng committed May 10, 2024
1 parent 256a238 commit 259760a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/pyspark/sql/connect/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
)
from pyspark.sql.connect.functions import builtin as F
from pyspark.sql.pandas.types import from_arrow_schema
from pyspark.sql.pandas.functions import _validate_pandas_udf # type: ignore[attr-defined]


if TYPE_CHECKING:
Expand Down Expand Up @@ -1997,6 +1998,7 @@ def _map_partitions(
) -> ParentDataFrame:
from pyspark.sql.connect.udf import UserDefinedFunction

_validate_pandas_udf(func, evalType)
udf_obj = UserDefinedFunction(
func,
returnType=schema,
Expand Down

0 comments on commit 259760a

Please sign in to comment.