Fix precision loss in large integral string conversions (#3405) ## Summary Fixes precision loss when converting large integral strings in two runtime paths: - `StringLiteral.to(IntegerType/LongType)` - `partition_to_py(...)` for integral and time-based partition values backed by integers ## Root cause Both paths were converting through `float` before converting to `int`, which loses precision for values outside the IEEE-754 exact integer range. That caused valid 64-bit integers like `LongType.max` and `9007199254740993` to be corrupted. ## What changed - Replaced `int(float(...))` with exact integer parsing in `partition_to_py` - For `StringLiteral.to(IntegerType/LongType)`, exact integral strings now use exact integer parsing while fractional numeric strings retain the existing truncation behavior - Added regression tests for `LongType.max` and `9007199254740993` ## Validation - `uv run pytest tests/expressions/test_literals.py tests/test_conversions.py` Closes #3404.
PyIceberg is a Python library for programmatic access to Iceberg table metadata as well as to table data in Iceberg format. It is a Python implementation of the Iceberg table spec.
The documentation is available at https://py.iceberg.apache.org/.