TruncateTransform.satisfies_order_of raises AttributeError for different widths
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 82/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Calme
- Stack technique
- python
- Domaine
- data-engineering
Piste de recherche
Commencez dans pyiceberg/transforms.py à TruncateTransform.satisfies_order_of et examinez le constructeur associé ainsi que la propriété source_type. Exécutez les cas ciblés dans tests/test_transforms.py autour des lignes 501-512, puis ajoutez une couverture pour différentes largeurs. C’est terminé lorsque les comparaisons renvoient les valeurs booléennes attendues sans accéder à un attribut non initialisé.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Apache Iceberg version
0.11.0 (latest release)
Please describe the bug 🐞
Description
Calling TruncateTransform.satisfies_order_of with two valid truncate transforms that have different widths raises an AttributeError instead of returning a boolean.
Same-width comparisons work because the method returns early when the transforms are equal.
Reproduction
from pyiceberg.transforms import TruncateTransform
TruncateTransform(5).satisfies_order_of(TruncateTransform(3))
On main at commit 48e710d20ceeeaa637d5aeae7746b787410859f8, this raises:
AttributeError: 'TruncateTransform' object has no attribute '_source_type'
The failure reproduces consistently. The same code is also present in the 0.11.1 release.
Expected behavior
The method should compare the truncate widths and return a boolean:
assert TruncateTransform(5).satisfies_order_of(TruncateTransform(3))
assert not TruncateTransform(3).satisfies_order_of(TruncateTransform(5))
This matches the current Apache Iceberg Java implementation:
Cause
TruncateTransform.__init__ initializes _width but not _source_type. However, satisfies_order_of still accesses the source_type property backed by _source_type:
The existing unit test only compares a transform with itself, so it returns before reaching the failing branch:
A focused fix could compare TruncateTransform widths directly, consistent with the Java implementation, and add regression cases for different widths.
I would be happy to contribute the fix and regression tests.
Willingness to contribute
- I can contribute a fix for this bug independently
- I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- I cannot contribute a fix for this bug at this time
- Langage dominant
- Python
- Étoiles
- 1.1k
- Forks
- 589
- Merge moyen
- 2 j 4 h
- PR mergées (30 j)
- 72
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/iceberg-python
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/iceberg-python#3996 ·
-
Deletion vector bitmap count is read from the blob and used as a loop bound without validation Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
apache/iceberg-python#3979 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/iceberg-python#3885 ·
-
[Bug] PyArrowFileIO fails to propagate s3.ssl.ca-cert to pyarrow.fs.S3FileSystem tls_ca_file_path Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
apache/iceberg-python#3866 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/iceberg-python#3836 · 1 commentaire ·
Toutes les issues de apache/iceberg-python
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100