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.
4 files changed
tree: 815bff79b85c4b9d90b49fcdb7401aba45110a7e
  1. .github/
  2. dev/
  3. mkdocs/
  4. notebooks/
  5. pyiceberg/
  6. tests/
  7. vendor/
  8. .asf.yaml
  9. .codespellrc
  10. .gitignore
  11. .markdownlint.yaml
  12. .pre-commit-config.yaml
  13. LICENSE
  14. Makefile
  15. MANIFEST.in
  16. NOTICE
  17. pyproject.toml
  18. README.md
  19. ruff.toml
  20. setup.py
  21. uv.lock
README.md

Iceberg Python

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/.

Get in Touch