xinrong-databricks commented on code in PR #36893:
URL: https://github.com/apache/spark/pull/36893#discussion_r918171922


##########
python/pyspark/sql/session.py:
##########
@@ -1023,6 +1023,20 @@ def prepare(obj: Any) -> Any:
 
         if isinstance(data, RDD):
             rdd, struct = self._createFromRDD(data.map(prepare), schema, 
samplingRatio)
+        elif isinstance(data, list) and schema is None:
+            # Wrap each element with a tuple if there is any scalar in the list
+
+            has_scalar = any(
+                isinstance(x, str)
+                or (
+                    not isinstance(x, Sized)
+                    and (type(x).__module__ == object.__module__)  # built-in

Review Comment:
   Accepts native Python scalars only.
   
   Supporting numpy/pandas scalars will be implemented 
https://issues.apache.org/jira/browse/SPARK-39745.



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