Skip to content

Commit 8c0c6ac

Browse files
Jason MokJason Mok
Jason Mok
authored and
Jason Mok
committed
TST: load a datetime saved as feather
1 parent 236d89b commit 8c0c6ac

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pandas/tests/io/test_feather.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""test feather-format compat"""
22

33
import zoneinfo
4+
from datetime import datetime
45

56
import numpy as np
67
import pytest
@@ -247,3 +248,16 @@ def test_string_inference(self, tmp_path):
247248
result = read_feather(path)
248249
expected = pd.DataFrame(data={"a": ["x", "y"]}, dtype="string[pyarrow_numpy]")
249250
tm.assert_frame_equal(result, expected)
251+
252+
def test_out_of_bounds_datetime_to_feather(self):
253+
# GH#47832
254+
df = pd.DataFrame({"date": [
255+
datetime.fromisoformat("1654-01-01"),
256+
datetime.fromisoformat("1920-01-01"),
257+
],})
258+
259+
feather_path = "tmp.feather"
260+
to_feather(feather_path)
261+
expected = df.copy()
262+
result = read_feather(feather_path)
263+
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)