apache / apache/arrow

[Python] Allow pyarrow import to fail without triggering Py_FatalError

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

Description

### Describe the enhancement requested

The initialization of `pyarrow` calls `InitDatetime` which if it fails to import the PyDateTime CAPI capsule will call:

```c
Py_FatalError("Could not import datetime C API")
```

Depending on conditions at the time of initialization, this will crash the calling process. Would it be possible to instead fail the import of `pyarrow` rather than trying to abort all Python execution?

### 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.