jatorre opened a new pull request, #4296:
URL: https://github.com/apache/iceberg-python/pull/4296
Closes #4295
# Rationale for this change
`AvroFileHeader.compression_codec()` read a missing `avro.codec` entry as
`TableProperties.WRITE_AVRO_COMPRESSION_DEFAULT` ("gzip"), an Iceberg property
value rather than an Avro codec name, and raised `Unsupported codec: gzip`. The
Avro specification makes `null` the default, so a file without the entry is
uncompressed. iceberg-rust writes manifests that way
(apache/iceberg-rust#3640), so PyIceberg could not scan a table with a snapshot
committed from iceberg-rust.
The writer side (`AvroOutputFile._write_header`) is unchanged: it still
writes the entry, mapping the Iceberg name to the Avro one.
## Are these changes tested?
`test_missing_codec_is_null` in `tests/avro/test_file.py` (it fails on main
with the error above). `tests/avro/test_file.py` and
`tests/avro/test_reader.py` pass (41); ruff is clean. End to end, PyIceberg
read a manifest written by iceberg-rust without the entry.
## Are there any user-facing changes?
Avro files without `avro.codec` are now read instead of refused.
AI disclosure: drafted with Claude Code (Claude Opus 5.5) at my direction; I
ran the tests and ruff.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]