apache / apache/arrow

[C++] Importing Decimal with invalid range from C Data Interface results in a crash

Open
#45,856 0 comments 0 reactions 0 assignees View on GitHub
Component: C++ 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.

Found when adding Decimal 32 support to nanoarrow/R!

```python
import nanoarrow as na
import pyarrow as pa

pa.DataType._import_from_c_capsule(
na.c_schema(na.null()).modify(format="d:10,0,32").__arrow_c_schema__()
)
#> The Kernel crashed while executing code in the current cell or a previous cell.
#> Bad status: Invalid: Decimal precision out of range [1, 9]: 10
```

We should probably check the precision on import and raise an error there?

### Component(s)

C++

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.