apache / apache/arrow

[Python] Arrow converts pandas Timedeltas with time unit 'ms' or higher to 0

Open
#40,620 0 comments 0 reactions 0 assignees View on GitHub
Component: Python Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the bug, including details regarding any error messages, version, and platform.

```python
>>> pa.Array.from_pandas(pd.Series([pd.Timedelta(np.timedelta64(1, 'ms'))], dtype=object))

[
0
]
```

The number `1` doesn't matter, but the time unit has to be `'ms'` or larger and the dtype has to be `object` to trigger the error.

The same error can be triggered more simply via:

```python
>>> pa.array([pd.Timedelta(np.timedelta64(1, 'ms'))])

[
0
]
```

### Component(s)

Python

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.