You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/08/04 14:15:51 UTC

[GitHub] [arrow] jorisvandenbossche commented on a change in pull request #10866: ARROW-3448: [Python] Pandas roundtrip doesn't preserve list of datetime objects

jorisvandenbossche commented on a change in pull request #10866:
URL: https://github.com/apache/arrow/pull/10866#discussion_r682657996



##########
File path: python/pyarrow/tests/pandas_examples.py
##########
@@ -143,13 +143,27 @@ def dataframe_with_lists(include_index=False, parquet_compatible=False):
         None,
         [time(0, 0, 0), time(18, 0, 2), time(12, 7, 3)]
     ]
+    datetime_data = [
+        [datetime(2015, 1, 5, 12, 0, 0), datetime(2020, 8, 22, 10, 5, 0)],
+        [datetime(2024, 5, 5, 5, 49, 1), datetime(2015, 12, 24, 22, 10, 17)],
+        [datetime(1996, 4, 30, 2, 38, 11)],
+        None,
+        [datetime(1987, 1, 27, 8, 21, 59)]
+    ]
+    pandas_timestamp_data = [
+        list(map(pd.Timestamp, x)) if x else None for x in datetime_data
+    ]
 
     temporal_pairs = [
         (pa.date32(), date_data),
         (pa.date64(), date_data),
         (pa.time32('s'), time_data),
         (pa.time32('ms'), time_data),
-        (pa.time64('us'), time_data)
+        (pa.time64('us'), time_data),
+        (pa.timestamp('s'), datetime_data),
+        (pa.timestamp('ms'), datetime_data),
+        (pa.timestamp('us'), datetime_data),
+        (pa.timestamp('ns'), pandas_timestamp_data),

Review comment:
       Do you get an error when you pass `datetime_data` here? (there are no nanoseconds here, so I would expect this to not matter)




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org