aio-libs / aio-libs/aiokafka

[QUESTION] What are the requirements for the C extensions ?

未關閉
#896 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
question
主要語言
Python
星號
1.4k
分支
269
平均合併
1 天 1 小時
30 天內合併 PR
6

描述

It seems by default aiokafka tries to load C extensions for core/cpu intensive operations. I have seen various blocks initializing it like
```py
try:
from ._crecords import (
DefaultRecordBatchBuilder as _DefaultRecordBatchBuilderCython,
DefaultRecordMetadata as _DefaultRecordMetadataCython,
DefaultRecordBatch as _DefaultRecordBatchCython,
DefaultRecord as _DefaultRecordCython,
)
DefaultRecordBatchBuilder = _DefaultRecordBatchBuilderCython
DefaultRecordMetadata = _DefaultRecordMetadataCython
DefaultRecordBatch = _DefaultRecordBatchCython
DefaultRecord = _DefaultRecordCython
except ImportError: # pragma: no cover
DefaultRecordBatchBuilder = _DefaultRecordBatchBuilderPy
DefaultRecordMetadata = _DefaultRecordMetadataPy
DefaultRecordBatch = _DefaultRecordBatchPy
DefaultRecord = _DefaultRecordPy
```

My issue is that it is not clear from the documentation what could lead to the extension not being loaded (i.e the except block) and it could be a bit silent. Like do I need specific libs to be installed on the OS for the extension to work ?

Then according the answer, do you think it could be useful to log a warning when we hit an ImportError like "Unable to load C extensions, fallback to less performant Python bindings" ?

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。