vishnuprakaz opened a new pull request, #3505:
URL: https://github.com/apache/iceberg-python/pull/3505
# Rationale for this change
`timestamptz_to_nanos` should raise a clear "Missing zone
offset" error when it's given a nanosecond timestamp that has no
timezone. Today it can't: the check meant to detect a zone-less
timestamp accidentally tests the *same* pattern as the success
check right above it, so it never matches. The input falls
through to the vague "Invalid timestamp with zone" error
instead.
The fix is one line check the zone-less pattern
(`ISO_TIMESTAMP_NANO`) instead, mirroring
`timestamptz_to_micros`, which already does this correctly.
(Introduced in #1632.)
## Are these changes tested?
Yes added tests covering the error messages for both
`timestamptz_to_nanos` and `timestamp_to_nanos`.
## Are there any user-facing changes?
Only a clearer error message: a zone-less nanosecond timestamp
now reports "Missing zone offset" instead of "Invalid timestamp
with zone". No API changes.
--
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]