TruncateTransform.satisfies_order_of raises AttributeError for different widths
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- python
- Ambito
- data-engineering
Direzione di ricerca
Inizia in pyiceberg/transforms.py da TruncateTransform.satisfies_order_of e controlla il costruttore correlato e la proprietà source_type. Esegui i casi mirati in tests/test_transforms.py intorno alle righe 501-512, quindi aggiungi la copertura per larghezze diverse. Il lavoro è completato quando i confronti restituiscono i valori booleani attesi senza accedere a un attributo non inizializzato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 1.1k
- Fork
- 589
- Merge medio
- 2g 4h
- PR unite (30g)
- 72
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/iceberg-python
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/iceberg-python#3996 ·
-
Deletion vector bitmap count is read from the blob and used as a loop bound without validation Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/iceberg-python#3979 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/iceberg-python#3885 ·
-
[Bug] PyArrowFileIO fails to propagate s3.ssl.ca-cert to pyarrow.fs.S3FileSystem tls_ca_file_path Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/iceberg-python#3866 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/iceberg-python#3836 · 1 commento ·
Tutte le issue di apache/iceberg-python
Issue simili
-
triage/confirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
NousResearch/hermes-agent#118866 ·
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
apache/cloudstack#14222 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100