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

 ##########
 File path: python/pyspark/sql/tests/test_arrow.py
 ##########
 @@ -383,6 +383,19 @@ def test_timestamp_dst(self):
         assert_frame_equal(pdf, df_from_python.toPandas())
         assert_frame_equal(pdf, df_from_pandas.toPandas())
 
+    def test_timestamp_nat(self):
+        import pandas as pd
+        dt1 = [pd.NaT, pd.Timestamp('2019-06-11')] * 100
+        dt2 = [None, pd.Timestamp('2019-06-11')] * 100
+        pdf1 = pd.DataFrame({'time': dt1})
+        pdf2 = pd.DataFrame({'time': dt2})
+
+        df1 = self.spark.createDataFrame(pdf1)
+        df2 = self.spark.createDataFrame(pdf2)
 
 Review comment:
   Also checked non-arrow codepath

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

Reply via email to