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_r293038513
 
 

 ##########
 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:
   I think you can just combine these to 1 DataFrame, but I think it would be 
good to also check against toPandas 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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to