Skip to content

COMPAT: Workaround invalid PyArrow duration conversion #54678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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