You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/02/07 19:28:22 UTC

[GitHub] [spark] LucaCanali commented on a change in pull request #35391: [SPARK-38098][PYTHON] Add support for ArrayType of nested StructType to arrow-based conversion

LucaCanali commented on a change in pull request #35391:
URL: https://github.com/apache/spark/pull/35391#discussion_r800988645



##########
File path: python/pyspark/sql/pandas/types.py
##########
@@ -86,8 +86,13 @@ 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:

Review comment:
       I guess I went for the easy way with this PR, as I this is what I used for some tests I ran, where I needed to pass an array of struct to a mapInArrow. If that's not the preferred/correct implementation, however, that sounds like a show stopper.




-- 
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-unsubscribe@spark.apache.org

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



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