File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1
1
"""test feather-format compat"""
2
2
3
+ from datetime import datetime
3
4
import zoneinfo
4
5
5
6
import numpy as np
@@ -247,3 +248,20 @@ def test_string_inference(self, tmp_path):
247
248
result = read_feather (path )
248
249
expected = pd .DataFrame (data = {"a" : ["x" , "y" ]}, dtype = "string[pyarrow_numpy]" )
249
250
tm .assert_frame_equal (result , expected )
251
+
252
+ def test_out_of_bounds_datetime_to_feather (self , tmp_path ):
253
+ # GH#47832
254
+ df = pd .DataFrame (
255
+ {
256
+ "date" : [
257
+ datetime .fromisoformat ("1654-01-01" ),
258
+ datetime .fromisoformat ("1920-01-01" ),
259
+ ],
260
+ }
261
+ )
262
+
263
+ path = tmp_path / "tmp.feather"
264
+ df .to_feather (path )
265
+ expected = df .copy ()
266
+ result = read_feather (path )
267
+ tm .assert_frame_equal (result , expected )
You can’t perform that action at this time.
0 commit comments