anishmehta24 opened a new pull request, #4015: URL: https://github.com/apache/iceberg-python/pull/4015
# Rationale for this change Timestamptz strings that end in `Z` are rejected, even though `Z` is the ISO-8601 designator for UTC and Java's `OffsetDateTime.parse` accepts it: ```python table.scan(row_filter="ts >= '2023-06-01T00:00:00Z'") # ValueError: Invalid timestamp with zone: 2023-06-01T00:00:00Z (must be ISO-8601) ``` The same filter with `+00:00` works. `ISO_TIMESTAMPTZ` and `ISO_TIMESTAMPTZ_NANO` now accept `Z` as well as `+HH:MM`/`-HH:MM`. `Z` is swapped for `+00:00` before calling `datetime.fromisoformat`, because on Python 3.10 `fromisoformat` doesn't accept `Z`. ## Are these changes tested? Yes. There are new cases in `tests/utils/test_datetime.py` for `timestamptz_to_micros` and `timestamptz_to_nanos` with `Z`, and they fail without the change. The datetime, literal, transform and conversion tests pass (735). I also checked the `Z` case on Python 3.10. ## Are there any user-facing changes? Yes. Timestamptz literals and row filters now accept a trailing `Z`. -- 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]
