harshmotw-db commented on code in PR #48770:
URL: https://github.com/apache/spark/pull/48770#discussion_r1831696110
##########
python/pyspark/sql/tests/pandas/test_pandas_udf_scalar.py:
##########
@@ -752,46 +752,87 @@ def check_vectorized_udf_return_scalar(self):
def test_udf_with_variant_input(self):
df = self.spark.range(0, 10).selectExpr("parse_json(cast(id as
string)) v")
- from pyspark.sql.functions import col
- scalar_f = pandas_udf(lambda u: str(u), StringType())
+ scalar_f = pandas_udf(lambda u: u.apply(str), StringType(),
PandasUDFType.SCALAR)
Review Comment:
Yes, for the most part. I recall that for pandas UDFs to work, I also had to
add changes in `arrow_to_pandas` and `_create_batch` too because they treat
struct types in a special way. Example:
https://github.com/apache/spark/pull/48770/files#r1831583273
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]