Skip to content

Commit ce0640b

Browse files
Jason MokJason Mok
authored andcommitted
TST: load a datetime saved as feather
1 parent 236d89b commit ce0640b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pandas/tests/io/test_feather.py

Lines changed: 16 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,18 @@ 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({
255+
"date": [
256+
datetime.fromisoformat("1654-01-01"),
257+
datetime.fromisoformat("1920-01-01"),
258+
]
259+
})
260+
261+
feather_path = "tmp.feather"
262+
df.to_feather(feather_path)
263+
expected = df.copy()
264+
result = pd.read_feather(feather_path)
265+
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)