LucaCanali commented on code in PR #35391:
URL: https://github.com/apache/spark/pull/35391#discussion_r1567471077


##########
python/pyspark/sql/pandas/types.py:
##########
@@ -86,8 +86,15 @@ def to_arrow_type(dt: DataType) -> "pa.DataType":
     elif type(dt) == DayTimeIntervalType:
         arrow_type = pa.duration("us")
     elif type(dt) == ArrayType:
-        if type(dt.elementType) in [StructType, TimestampType]:
+        if type(dt.elementType) == TimestampType:
             raise TypeError("Unsupported type in conversion to Arrow: " + 
str(dt))
+        elif type(dt.elementType) == StructType:
+            if LooseVersion(pa.__version__) < LooseVersion("2.0.0"):
+                raise TypeError(
+                    "Array of StructType is only supported with pyarrow 2.0.0 
and above"

Review Comment:
   Hi, @itholic thank you for reporting this.
   I have tried to reproduce the reported issue in my environment, but I get 
the expected result instead (I use Python 3.11, Spark 3.5.1, pyarrow 11). Can 
you please confirm that you still have this issue?



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to