You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "ueshin (via GitHub)" <gi...@apache.org> on 2023/03/20 20:08:41 UTC

[GitHub] [spark] ueshin opened a new pull request, #40497: [SPARK-42875][CONNECT][PYTHON] Fix toPandas to handle timezone and map types properly

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


[GitHub] [spark] zhengruifeng closed pull request #40497: [SPARK-42875][CONNECT][PYTHON] Fix toPandas to handle timezone and map types properly

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #40497: [SPARK-42875][CONNECT][PYTHON] Fix toPandas to handle timezone and map types properly
URL: https://github.com/apache/spark/pull/40497


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


[GitHub] [spark] zhengruifeng commented on pull request #40497: [SPARK-42875][CONNECT][PYTHON] Fix toPandas to handle timezone and map types properly

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #40497:
URL: https://github.com/apache/spark/pull/40497#issuecomment-1477168751

   merged to master/branch-3.4


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