apache / apache/iceberg-python

Implementation classes named in table properties are imported and instantiated without a type check

未關閉
#3,932 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
Python
星號
1.1k
分支
581
平均合併
1 天 17 小時
30 天內合併 PR
78

描述

Three properties name a class that PyIceberg imports and calls:

| Property | Resolved by | Called as |
|---|---|---|
| `py-io-impl` | `_import_file_io` (`pyiceberg/io/__init__.py`) | `class_(properties)` |
| `write.py-location-provider.impl` | `_import_location_provider` (`pyiceberg/table/locations.py`) | `class_(table_location, table_properties)` |
| `s3.retry-strategy-impl` | `_import_retry_strategy` (`pyiceberg/io/pyarrow.py`) | `class_()` |

Each follows the same pattern:

```python
module = importlib.import_module(module_name)
class_ = getattr(module, class_name)
return class_(...)
```

None of the three checks that the resolved object is the type it is about to be used as — there is no `issubclass` against `FileIO`, `LocationProvider`, or `S3RetryStrategy`. Any importable dotted name resolves and is called, with the property map passed as an argument in two of the three cases.

All three properties are read from the merged table property map, so their values can originate in a table's metadata rather than in the operator's catalog configuration.

---
Issue investigation generated via claude, reviewed by Sung, Kevin, Fokko.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

從 pyiceberg/io/__init__.py 中的 _import_file_io、pyiceberg/table/locations.py 中的 _import_location_provider,以及 pyiceberg/io/pyarrow.py 中的 _import_retry_strategy 開始。追蹤每個屬性如何解析與呼叫,然後確認在實例化之前只接受 FileIO、LocationProvider 或 S3RetryStrategy 的子類別;完成的標準是三個路徑都拒絕無關的可匯入類別。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
security
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
活躍
描述清晰度
基本清楚
新手友好度
68/100

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

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