-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: DatetimeIndex.shift(freq=...) raises near DST boundary #8616
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
sounds like you need an ambiguous kw here to figure out what the user wants? or is this just not well defined ? or is it just implemted incorrectly eg seems to me you convert to utc, shift, convert back to the tz |
Additionally the same time zone across different versions of |
It's just a vectorized addition of an offset to a bunch of Timestamps, which is well-defined regardless of whether the Timestamps are aware or not. The problem isn't that the computation is wrong; it's that the assertion at the end is too strict. Trying to fix this pushed PEP 431 several notches up my list of things to be excited about. |
xref #5694 #8531 (?)
xref #8817
This is presumably caused by the fact that pytz time zones internalize the offset of the current time.
Playing with
dateutil
andpytz
timezones makes me despair of repairing that assertion to be anything sane. Is it actually needed, or can we just turn it into a warning?Observations:
pytz.DstTzInfo
s of the same zoneinfo zone that have been.normalize()
ed to different times may compare differentpytz.*TzInfo
has azone
member containing the name of the zoneinfo zone from which it was constructeddateutil.tzfile
has no public members beyond thetzinfo
API, which is insufficient to tell whether two time zones are equalpytz
time zone and adateutil
time zone appear to compare different under all circumstances, regardless of whether they represent the same time zonedateutil
time zone classes have no common base class within thedateutil
packagepytz
zones constructed from different names for the same zoneinfo zone (e.g.UTC
andEtc/UTC
) compare differentUgh.
from #8817
The text was updated successfully, but these errors were encountered: