`inspect.entries()` raises TypeError when a data file has no column_sizes
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start by finding the implementation of inspect.entries() and compare how it handles optional column_sizes with files() and the three count columns noted in the issue. Reproduce with the supplied example or a DuckDB-written table that omits column_sizes; done means entries() returns the row with column_sizes as None instead of raising TypeError.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 664
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 131
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/iceberg-python
-
StringLiteral to IntegerType/LongType silently truncates fractional strings, changing predicate meaningPossibly taken @Shahzeb-DataEngineer claimed this today. Openkind:bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/iceberg-python#4382 · 2 comments ·
Maintainers usually reply within 1 day
-
`inspect.files()` and the other file metadata tables raise `ArrowInvalid` when a snapshot has no manifestsPossibly taken @YuangGao claimed this 12 days ago. Openkind:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/iceberg-python#4269 ·
Maintainers usually reply within 1 day
-
`older_than` reads a naive datetime as UTC and expires snapshots it should keepPossibly taken @Rahul-cs50 claimed this 14 days ago. Openkind:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/iceberg-python#4182 · 1 comment ·
Maintainers usually reply within 1 day
-
REST: Send empty first-page pageToken when rest-page-size is setPossibly taken @ehddnr301 claimed this 33 days ago. Openkind:bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
apache/iceberg-python#4096 ·
Maintainers usually reply within 1 day
-
PyArrowFileIO: every small S3 write is a 3-request multipart upload; expose allow_delayed_openPossibly taken @David-Banquet claimed this 30 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
apache/iceberg-python#4093 · 3 comments ·
Maintainers usually reply within 1 day
All issues in apache/iceberg-python
Similar issues
-
ライブラリを追加Openpriority middle
Difficulty 1/5 Under an hour Newbie friendliness 62/100
KATO-Hiro/AtCoderClans#13015 ·
Maintainers usually reply within 1 day
-
request-theme
Difficulty 2/5 Under an hour Newbie friendliness 62/100
LizardByte/ThemerrDB#10024 · 2 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
btclib-org/btclib-node#2505 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
open-webui/open-webui#34462 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
KLayout/klayout#2554 · 1 comment ·
Maintainers usually reply within 1 day