You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug, including details regarding any error messages, version, and platform.
#11358 refactored the timezone offset handling in string parsing (both in read_csv, casting str->timestamp and strptime).
The general rule was that if there is a %z in the format string you provide to strptime, we apply the offset and return a timestamp type with tz=UTC.
But this seems to work only in certain cases:
# space before %z -> works>>>pc.strptime(["5/1/2020 +0100", None, "12/11/1900 -0130"], format="%m/%d/%Y %z", unit='us').typeTimestampType(timestamp[us, tz=UTC])
# no space before %z -> doesn't work>>>pc.strptime(["5/1/2020+0100", None, "12/11/1900-0130"], format="%m/%d/%Y%z", unit='us').typeTimestampType(timestamp[us])
Component(s)
C++
The text was updated successfully, but these errors were encountered:
### Rationale for this change
See gh-35448 for the failing example. The current code in `GetZone` was assuming there was always some character between the `%z` and the preceding `%` code (like a whitespace, or `-` or `/`). That is often not the case with `%z` (in time formats like `00:00+01`, the `+` is part of `%z`, and so the format is `%H:%M%z` without character between `%M` and `%z`)
### Are these changes tested?
Test is added
### Are there any user-facing changes?
The result type will no now correctly have a `tz=UTC` parametrization
* Closes: #35448
Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
…35449)
### Rationale for this change
See apachegh-35448 for the failing example. The current code in `GetZone` was assuming there was always some character between the `%z` and the preceding `%` code (like a whitespace, or `-` or `/`). That is often not the case with `%z` (in time formats like `00:00+01`, the `+` is part of `%z`, and so the format is `%H:%M%z` without character between `%M` and `%z`)
### Are these changes tested?
Test is added
### Are there any user-facing changes?
The result type will no now correctly have a `tz=UTC` parametrization
* Closes: apache#35448
Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
Describe the bug, including details regarding any error messages, version, and platform.
#11358 refactored the timezone offset handling in string parsing (both in read_csv, casting str->timestamp and strptime).
The general rule was that if there is a
%z
in the format string you provide tostrptime
, we apply the offset and return a timestamp type with tz=UTC.But this seems to work only in certain cases:
Component(s)
C++
The text was updated successfully, but these errors were encountered: