allisonwang-db commented on code in PR #41867:
URL: https://github.com/apache/spark/pull/41867#discussion_r1256161575


##########
python/pyspark/sql/pandas/serializers.py:
##########
@@ -388,13 +388,7 @@ def _create_batch(self, series):
 
         arrs = []
         for s, t in series:
-            if self._struct_in_pandas == "dict" and t is not None and 
pa.types.is_struct(t):
-                if not isinstance(s, pd.DataFrame):
-                    raise PySparkValueError(
-                        "A field of type StructType expects a 
pandas.DataFrame, "
-                        "but got: %s" % str(type(s))
-                    )
-
+            if t is not None and pa.types.is_struct(t) and isinstance(s, 
pd.DataFrame):

Review Comment:
   cc @xinrong-meng @ueshin 



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