BryanCutler commented on a change in pull request #24844: [SPARK-28003][PYTHON]
Allow NaT values when creating Spark dataframe from pandas with Arrow
URL: https://github.com/apache/spark/pull/24844#discussion_r293491513
##########
File path: python/pyspark/sql/tests/test_arrow.py
##########
@@ -383,6 +383,16 @@ def test_timestamp_dst(self):
assert_frame_equal(pdf, df_from_python.toPandas())
assert_frame_equal(pdf, df_from_pandas.toPandas())
+ # Regression test for SPARK-28003
+ def test_timestamp_nat(self):
+ dt = [pd.NaT, pd.Timestamp('2019-06-11'), None] * 100
+ pdf = pd.DataFrame({'time': dt})
+
+ for arrow_enabled in [False, True]:
Review comment:
you can just use `_toPandas_arrow_toggle` which returns 2 DataFrames with
and without arrow
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]