zhengruifeng commented on code in PR #49802:
URL: https://github.com/apache/spark/pull/49802#discussion_r1942207493


##########
python/pyspark/ml/connect/serialize.py:
##########
@@ -131,11 +132,19 @@ def serialize_param(value: Any, client: 
"SparkConnectClient") -> pb2.Expression.
 
 def serialize(client: "SparkConnectClient", *args: Any) -> List[Any]:
     from pyspark.sql.connect.dataframe import DataFrame as ConnectDataFrame
+    from pyspark.sql.connect.expressions import LiteralExpression
 
     result = []
     for arg in args:
         if isinstance(arg, ConnectDataFrame):
             result.append(pb2.Fetch.Method.Args(input=arg._plan.plan(client)))
+        elif isinstance(arg, tuple) and len(arg) == 2 and isinstance(arg[1], 
DataType):

Review Comment:
   we can not infer the datatype from an empty list, so we need a way to 
specify the type



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

Reply via email to