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
DatetimeIndex.to_series has a keep_tz keyword with a default of False (= dropping the timezone information). This stems from a time we could not store datetime tz data inside a series (with keep_tz=True, you would get an object dtyped Series of Timestamps). Nowadays this just gives a series with datetime64[ns, tz] dtype, so it makes sense to make this the default and deprecate the keyword.
Since it is an API change, ideally we first raise a warning that the behaviour will be changed (the default will change from False to True). You could then suppress this warning by passing keep_tz=True.
However, that means that we cannot directly deprecate the keyword itself, as we have to keep it for suppressing the warning / getting the future behaviour.
The text was updated successfully, but these errors were encountered:
Indeed, how we approach this will depend on when the release gets cut. If we get this in before the cut, we could easily just change the default behavior + deprecate in one PR. Otherwise, we would have to split it into two across multiple releases.
Why does this depend on when the rc gets cut? (when I mentioned it, I was referring to whether I would have time to do it before the rc gets cut)
How can we change the behaviour and deprecate in one PR? You mean just changing the behaviour without warning? Which is actually certainly an option, as this prevents having to do the deprecation in two steps (first behaviour, then keyword), and I don't think this is that much used, so I am OK with just a back incompat breaking change.
xref #17826
DatetimeIndex.to_series
has akeep_tz
keyword with a default of False (= dropping the timezone information). This stems from a time we could not store datetime tz data inside a series (withkeep_tz=True
, you would get an object dtyped Series of Timestamps). Nowadays this just gives a series withdatetime64[ns, tz]
dtype, so it makes sense to make this the default and deprecate the keyword.Since it is an API change, ideally we first raise a warning that the behaviour will be changed (the default will change from False to True). You could then suppress this warning by passing
keep_tz=True
.However, that means that we cannot directly deprecate the keyword itself, as we have to keep it for suppressing the warning / getting the future behaviour.
The text was updated successfully, but these errors were encountered: