apache / apache/iceberg-python
Implementation classes named in table properties are imported and instantiated without a type check
- Langage dominant
- Python
- Étoiles
- 1.1k
- Forks
- 581
- Merge moyen
- 1 j 17 h
- PR mergées (30 j)
- 78
Description
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.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par _import_file_io dans pyiceberg/io/__init__.py, _import_location_provider dans pyiceberg/table/locations.py et _import_retry_strategy dans pyiceberg/io/pyarrow.py. Suivez la façon dont chaque propriété est résolue et invoquée, puis vérifiez que seules les sous-classes de FileIO, LocationProvider ou S3RetryStrategy sont acceptées avant l’instanciation ; la tâche est terminée lorsque les trois chemins rejettent les classes importables sans rapport.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- security
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Active
- Clarté
- Plutôt claire
- Accessibilité débutants
- 68/100