File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 11"""test feather-format compat"""
22
33import zoneinfo
4+ from datetime import datetime
45
56import numpy as np
67import pytest
1112 ArrowStringArray ,
1213 StringArray ,
1314)
14-
1515from pandas .io .feather_format import read_feather , to_feather # isort:skip
1616
1717pytestmark = pytest .mark .filterwarnings (
@@ -247,3 +247,18 @@ def test_string_inference(self, tmp_path):
247247 result = read_feather (path )
248248 expected = pd .DataFrame (data = {"a" : ["x" , "y" ]}, dtype = "string[pyarrow_numpy]" )
249249 tm .assert_frame_equal (result , expected )
250+
251+ def test_out_of_bounds_datetime_to_feather (self ):
252+ # GH#47832
253+ df = pd .DataFrame ({
254+ "date" : [
255+ datetime .fromisoformat ("1654-01-01" ),
256+ datetime .fromisoformat ("1920-01-01" ),
257+ ]
258+ })
259+
260+ feather_path = "tmp.feather"
261+ df .to_feather (feather_path )
262+ expected = df .copy ()
263+ result = pd .read_feather (feather_path )
264+ tm .assert_frame_equal (result , expected )
You can’t perform that action at this time.
0 commit comments