[Python] Table.from_arrow can't import nan values into a non-null float column
Open
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.
This small examples fails with `ValueError: Field pyarrow.Field was non-nullable but pandas column had 1 null values` on 16.1.0.
```
import pandas as pd
import pyarrow as pa
df = pd.DataFrame({"a": [1.0, float("nan")]})
schema = pa.schema([pa.field('a', pa.float64(), nullable=False)])
pa.Table.from_pandas(df, schema=schema)
```
I guess this seems like a bug to me, but I'm no pandas expert. It does feel like this makes roundtripping a non-null float column through pandas impossible?
### Component(s)
Python
Contributor guide
Assessment
This issue has not been assessed yet.