`inspect.entries()` raises TypeError when a data file has no column_sizes

Đang mở Phù hợp với người mới
#4,186 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Rahul-cs50 đang làm issue này rồi.

Từ ngày 30/10/2026.

  • #4199 của @Rahul-cs50 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend, databases

Hướng nghiên cứu

Bắt đầu bằng cách tìm phần triển khai của inspect.entries() và so sánh cách nó xử lý column_sizes tùy chọn với files() và ba cột đếm được nêu trong issue. Tái hiện lỗi bằng ví dụ được cung cấp hoặc một bảng do DuckDB ghi mà không có column_sizes; hoàn thành khi entries() trả về hàng có column_sizes là None thay vì phát sinh TypeError.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

kind:bug
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
Ngôn ngữ chính
Python
Star
1.2k
Fork
654
Merge trung bình
2 ngày 11 giờ
Pull request đã merge (30 ngày)
122

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/iceberg-python

Tất cả issue của apache/iceberg-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.