Skip to content

Commit

Permalink
COMPAT: Workaround invalid PyArrow duration conversion (pandas-dev#54678
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mroeschke authored Aug 22, 2023
1 parent f5a8cce commit cc76b52
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pandas/core/arrays/arrow/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,9 @@ def convert_fill_value(value, pa_type, dtype):
return value
if isinstance(value, (pa.Scalar, pa.Array, pa.ChunkedArray)):
return value
if isinstance(value, Timedelta) and value.unit in ("s", "ms"):
# Workaround https://github.com/apache/arrow/issues/37291
value = value.to_numpy()
if is_array_like(value):
pa_box = pa.array
else:
Expand Down

0 comments on commit cc76b52

Please sign in to comment.