Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-49477][PYTHON] Improve pandas udf invalid return type error me…
…ssage ### What changes were proposed in this pull request? This PR improves the error message when the specified return type of a pandas udf mismatch the actual return type. ### Why are the changes needed? To improve the error message. Before this PR: `pyspark.errors.exceptions.base.PySparkValueError: A field of type StructType expects a pandas.DataFrame, but got: <class 'pandas.core.series.Series'>` After this PR: `pyspark.errors.exceptions.base.PySparkValueError: Invalid return type. Please make sure that the UDF returns a pandas.DataFrame when the specified return type is StructType.` ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? New unit test ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#47942 from allisonwang-db/spark-49477-pandas-udf-err-msg. Authored-by: allisonwang-db <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
- Loading branch information