ueshin opened a new pull request, #40497:
URL: https://github.com/apache/spark/pull/40497

   ### What changes were proposed in this pull request?
   
   Fix `DataFrame.toPandas()` to handle timezone and map types properly.
   
   ### Why are the changes needed?
   
   Currently `DataFrame.toPandas()` doesn't handle timezone for timestamp type, 
and map types properly.
   
   For example:
   
   ```py
   >>> schema = StructType().add("ts", TimestampType())
   >>> spark.createDataFrame([(datetime(1969, 1, 1, 1, 1, 1),), (datetime(2012, 
3, 3, 3, 3, 3),), (datetime(2100, 4, 4, 4, 4, 4),)], schema).toPandas()
                            ts
   0 1969-01-01 01:01:01-08:00
   1 2012-03-03 03:03:03-08:00
   2 2100-04-04 03:04:04-08:00
   ```
   
   which should be:
   
   ```py
                      ts
   0 1969-01-01 01:01:01
   1 2012-03-03 03:03:03
   2 2100-04-04 04:04:04
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   
   The result of `DataFrame.toPandas()` with timestamp type and map type will 
be the same as PySpark.
   
   ### How was this patch tested?
   
   Enabled the related tests.


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