Skip to content

DEPR: Timestamp.freq #33832

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

Closed
wants to merge 6 commits into from
Closed

Conversation

jbrockmendel
Copy link
Member

The motivation here is that I've concluded that DatetimeArray.freq must be removed, so for internal consistency Timestamp.freq should be removed too.

The main user-facing behavior this will affect is Timestamp.is_month_start, is_month_end, is_quarter_start, is_quarter_end, is_year_start, is_year_end, for which I guess we'll offer users an alternative(?)

@mroeschke
Copy link
Member

The main user-facing behavior this will affect is Timestamp.is_month_start, is_month_end, is_quarter_start, is_quarter_end, is_year_start, is_year_end, for which I guess we'll offer users an alternative(?)

I think all of these can be defined without frequency. Looks like there's already "no frequency" code path for these

        if self.freq is None:
            # fast-path for non-business frequencies
            return self.day == 1 and self.month % 3 == 1

@@ -78,6 +82,13 @@ def pytest_runtest_setup(item):
pytest.skip("skipping high memory test since --run-high-memory was not set")


def pytest_collection_modifyitems(config, items):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this show up in a lot of places?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I was putting pytestmark = ... in dozens of files and barely making a dent before putting it here instead

@jreback jreback added Deprecate Functionality to remove in pandas Frequency DateOffsets labels Apr 30, 2020
@jreback
Copy link
Contributor

jreback commented Apr 30, 2020

can you link to the deprecation removal issue as well

@jbrockmendel
Copy link
Member Author

I think all of these can be defined without frequency. Looks like there's already "no frequency" code path for these

You're right. The potential issue is if users want to get the old (i.e. current) behavior that as if there were a freq. I guess we can tell them to do DatetimeIndex([ts], freq=freq).whatever

@jorisvandenbossche
Copy link
Member

The current PR seems to generate a lot of warnings (from looking at the test changes) that shouldn't be propagated to the user?
(eg boxing a DatetimeIndex, converting to object dtyp, ... And I also noticed that accessing a single element from a DatetimeIndex raises the warning, and the DatetimeIndex repr, ...)

The main user-facing behavior this will affect is Timestamp.is_month_start, is_month_end, is_quarter_start, is_quarter_end, is_year_start, is_year_end, for which I guess we'll offer users an alternative(?)

Can you show with an example what is actually changing here?

@jbrockmendel
Copy link
Member Author

closing to clear the queue

@jbrockmendel jbrockmendel deleted the deprfreq branch May 22, 2020 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Frequency DateOffsets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DEPR: remove freq attribute of Timestamp?
4 participants