Skip to content

Commit cc59cec

Browse files
mroeschkemeeseeksmachine
authored andcommitted
Backport PR pandas-dev#54678: COMPAT: Workaround invalid PyArrow duration conversion
1 parent eb36710 commit cc59cec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pandas/core/arrays/arrow/array.py

+3
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,9 @@ def convert_fill_value(value, pa_type, dtype):
952952
return value
953953
if isinstance(value, (pa.Scalar, pa.Array, pa.ChunkedArray)):
954954
return value
955+
if isinstance(value, Timedelta) and value.unit in ("s", "ms"):
956+
# Workaround https://github.com/apache/arrow/issues/37291
957+
value = value.to_numpy()
955958
if is_array_like(value):
956959
pa_box = pa.array
957960
else:

0 commit comments

Comments
 (0)