Read a naive datetime in older_than as local time (#4220)

expire_snapshots().older_than() converted its cutoff with
datetime_to_millis, which reads a naive datetime as UTC. The docs call
it with datetime.now() - timedelta(...), a naive local time, so east of
UTC the cutoff landed later and expired snapshots that should be kept,
and west of UTC it landed earlier. A naive datetime is now read as local
time, as datetime.timestamp() does; an aware one is unchanged.

Closes #4182

Co-authored-by: Fokko Driesprong <fokko@apache.org>
2 files changed
tree: 4c46aedc2aa7b6d2b6411dcc2d154b512135e5f8
  1. .github/
  2. dev/
  3. mkdocs/
  4. notebooks/
  5. pyiceberg/
  6. tests/
  7. vendor/
  8. .asf.yaml
  9. .gitignore
  10. .markdown-link-check.json
  11. .markdownlint.yaml
  12. .pre-commit-config.yaml
  13. AGENTS.md
  14. LICENSE
  15. Makefile
  16. MANIFEST.in
  17. NOTICE
  18. pyproject.toml
  19. README.md
  20. SECURITY-THREAT-MODEL.md
  21. setup.py
  22. 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