`inspect.entries()` raises TypeError when a data file has no column_sizes
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Inizia trovando l’implementazione di inspect.entries() e confronta come gestisce column_sizes opzionale rispetto a files() e alle tre colonne di conteggio indicate nell’issue. Riproduci il problema con l’esempio fornito o con una tabella scritta da DuckDB che omette column_sizes; il lavoro è completato quando entries() restituisce la riga con column_sizes impostato a None invece di sollevare TypeError.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Apache Iceberg version
0.12.0 (latest release)
Please describe the bug 🐞
Currently, entries() builds column_sizes with dict(entry.data_file.column_sizes), so an entry without that optional field raises TypeError. files() handles it, and #1902 added or {} to the three count columns beside it for #1884.
import os, tempfile
import pyarrow as pa, pyarrow.parquet as pq
from pyiceberg.catalog.sql import SqlCatalog
from pyiceberg.manifest import DataFile, DataFileContent, FileFormat
from pyiceberg.typedef import Record
d = tempfile.mkdtemp()
cat = SqlCatalog("c", uri="sqlite:///:memory:", warehouse=f"file://{d}")
cat.create_namespace("ns")
t = cat.create_table("ns.t", schema=pa.schema([("x", pa.int64())]))
pq.write_table(pa.table({"x": [1]}), f"{d}/a.parquet")
f = DataFile.from_args(content=DataFileContent.DATA, file_path=f"file://{d}/a.parquet", file_format=FileFormat.PARQUET,
partition=Record(), record_count=1, file_size_in_bytes=os.path.getsize(f"{d}/a.parquet"))
with t.transaction() as tx:
with tx.update_snapshot().fast_append() as fa:
fa.append_data_file(f)
t.inspect.entries()
# TypeError: 'NoneType' object is not iterable, should be one row with column_sizes None
DuckDB 1.5.6 leaves column_sizes out of the data and delete files it writes, so entries() fails on tables it wrote.
tested on pyiceberg 0.12.0 and main
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.2k
- Fork
- 654
- Merge medio
- 2g 11h
- PR unite (30g)
- 122
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
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
-
`inspect.files()` and the other file metadata tables raise `ArrowInvalid` when a snapshot has no manifestsForse già presa @YuangGao l’ha presa 10 giorni fa. Apertakind:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/iceberg-python#4269 ·
I maintainer di solito rispondono entro 1 giorno
-
`older_than` reads a naive datetime as UTC and expires snapshots it should keepForse già presa @Rahul-cs50 l’ha presa 13 giorni fa. Apertakind:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/iceberg-python#4182 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
REST: Send empty first-page pageToken when rest-page-size is setForse già presa @ehddnr301 l’ha presa 32 giorni fa. Apertakind:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
apache/iceberg-python#4096 ·
I maintainer di solito rispondono entro 1 giorno
-
PyArrowFileIO: every small S3 write is a 3-request multipart upload; expose allow_delayed_openForse già presa @David-Banquet l’ha presa 29 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
apache/iceberg-python#4093 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
apache/iceberg-python#4010 · 4 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/iceberg-python
Issue simili
-
Unknown stop ID in slow zone data crashes post formatting and skips the rest of that day's postsApertabackend bug tm-new-volunteer
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
transitmatters/mbta-slow-zone-bot#81 · 1 commento ·
-
area:schema documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
risk:high type:ci
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
spacetelescope/rdmt-spire#49 ·
I maintainer di solito rispondono entro 1 giorno