-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
API: should only Area/Location time-zone-identifiers (other than UTC) be allowed? #53250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The New [11] has UTC instead of UTC+1. Is that intentional? I'm skeptical of that. Why disallow The relevant code paths just dispatch to pytz.timezone, and in 3.0 will dispatch to zoneinfo.ZoneInfo. This seems benign. |
yup - in #50887 (comment) we discussed converting offset-aware strings to UTC and getting rid of the '+01:00' isn't ambiguous, but it's not really a meaningful time zone - it doesn't handle whether DST is present, or historical changes. People might put '+01:00' because they know that their time zone is '+01:00', but then forget that their country observes DST, whereas if they'd put 'Europe/Paris' then that would've been handled for them |
Thanks for clarifying. Should I comment on the +01:00 case on the linked thread to keep discussion here focused? |
perhaps let's keep that here, and leave the other thread to the topic of disallowing parsing multiple offsets into an Object Index/Series |
OK. So the suggestion is to make |
that's right hmm I wouldn't have thought |
I am not sure how I feel about this.
I agree that Area/Location timezones are more useful for subsequent features, but anecdotally I feel UTC offset tz lurk more in the wild |
In general having the scalar behavior match the non-scalar behavior is pretty important. We'd need a compelling reason to have them differ. |
ok sure, makes sense - closing then, thanks for discussing |
Currently, it's possible to set all kinds of time zones, such as:
In https://en.wikipedia.org/wiki/List_of_tz_database_time_zones, it's recommended that people use an 'Area/Location' time zone identifier instead - e.g.
'Africa/Lagos'
instead of the first,'Europe/Paris'
instead of the second, and'America/Havana'
instead of the third.Trying to pass non-area/location tz-identifiers opens people up to common misconceptions and traps about time zones, e.g. that despite Greenwich being in London, London does not observe GMT (it only does for half the year)
In https://en.wikipedia.org/wiki/List_of_tz_database_time_zones, for every single tz-identifier which isn't in the 'Area/Location' format, there's a link to one which is, suggesting to use that one instead.
Would it be safe to make such a restriction?
cc @mroeschke @jbrockmendel @pganssle @rebecca-palmer (sorry for the pings, would really value your input here if possible!)
This would go hand-in-hand with #50887. What we'd get to in the end would be:
Current behaviour (pandas 2.0.1):
New behaviour (pandas 3.x):
The text was updated successfully, but these errors were encountered: