From 14dc724c3cd67e1a8e5c77458232167051f3a6bc Mon Sep 17 00:00:00 2001 From: Jason Mok Date: Tue, 5 Nov 2024 19:44:37 -0600 Subject: [PATCH] TST: load a datetime saved as feather TST: feather I/O with historical out-of-bounds datetime values TST: feather I/O with historical out-of-bounds datetime values TST: feather I/O with historical out-of-bounds datetime values --- pandas/tests/io/test_feather.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pandas/tests/io/test_feather.py b/pandas/tests/io/test_feather.py index dc82994bcbc7f..eb4a200d127a4 100644 --- a/pandas/tests/io/test_feather.py +++ b/pandas/tests/io/test_feather.py @@ -1,5 +1,6 @@ """test feather-format compat""" +from datetime import datetime import zoneinfo import numpy as np @@ -247,3 +248,15 @@ def test_string_inference(self, tmp_path): result = read_feather(path) expected = pd.DataFrame(data={"a": ["x", "y"]}, dtype="string[pyarrow_numpy]") tm.assert_frame_equal(result, expected) + + def test_out_of_bounds_datetime_to_feather(self): + # GH#47832 + df = pd.DataFrame( + { + "date": [ + datetime.fromisoformat("1654-01-01"), + datetime.fromisoformat("1920-01-01"), + ], + } + ) + self.check_round_trip(df)