jorisvandenbossche commented on code in PR #14448:
URL: https://github.com/apache/arrow/pull/14448#discussion_r1000254530


##########
python/pyarrow/tests/test_pandas.py:
##########
@@ -4472,6 +4472,21 @@ def test_timestamp_as_object_non_nanosecond(resolution, 
tz, dt):
         assert result[0] == expected
 
 
+def test_timestamp_as_object_pytz_offset():
+    # ARROW-16547 to_pandas with timestamp_as_object=True and FixedOffset
+    pytz = pytest.importorskip("pytz")
+    import datetime
+    timezone = pytz.FixedOffset(120)
+    dt = timezone.localize(datetime.datetime(2022, 5, 12, 16, 57))
+
+    table = pa.table({"timestamp_col": pa.array([dt])})
+
+    expected = table.to_pandas()

Review Comment:
   Instead of relying on the normal to_pandas conversion (and thus relying on 
the equality comparison between an actual pandas timestamp and datetime 
object), I would maybe check the result manually (you know that `dt` should 
roundtrip?)



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to