Skip to content
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

BUG: DTA/TDA setitem breaks freq on views #31218

Open
jbrockmendel opened this issue Jan 22, 2020 · 1 comment
Open

BUG: DTA/TDA setitem breaks freq on views #31218

jbrockmendel opened this issue Jan 22, 2020 · 1 comment
Labels
Bug Frequency DateOffsets
Milestone

Comments

@jbrockmendel
Copy link
Member

DatetimeArray/TimedeltaArray __setitem__ resets the array's freq to None, but this doesn't propagate to views:

dti = pd.date_range('2016-01-01', periods=5)
dta = dti._data
view = dta[:]
assert view.freq == dta.freq == "D"

dta[0] = pd.NaT
assert dta.freq is None

>>> view.freq
<Day>

view.freq is now incorrect.

It will be a hassle, but I think the thing to do is remove freq from DTA/TDA altogether. It has a different meaning from PeriodArray.freq and isn't necessary for the "vectorized Timestamp/Timedelta" abstraction.

@jbrockmendel
Copy link
Member Author

Current plan is to remove DTA/TDA.freq in 2.0

@jbrockmendel jbrockmendel modified the milestones: Contributions Welcome, 2.0 Dec 20, 2021
@mroeschke mroeschke modified the milestones: 2.0, 3.0 Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Frequency DateOffsets
Projects
None yet
Development

No branches or pull requests

3 participants