Skip to content

BUG: Negative freq in date_range produces values out of start and endpoints #56832

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

Merged
merged 18 commits into from
Mar 20, 2024

Conversation

jrmylow
Copy link
Contributor

@jrmylow jrmylow commented Jan 11, 2024

@jrmylow
Copy link
Contributor Author

jrmylow commented Jan 11, 2024

pre-commit.ci autofix

@MarcoGorelli
Copy link
Member

thanks, taking a look next week - could you fix up the conflicts please?

@MarcoGorelli MarcoGorelli self-requested a review January 12, 2024 11:43
@jrmylow
Copy link
Contributor Author

jrmylow commented Jan 14, 2024

pre-commit.ci autofix

@jrmylow
Copy link
Contributor Author

jrmylow commented Jan 14, 2024

Awaiting #56873 to fix the test failure in:

__________________ test_api_categorical[postgresql_adbc_conn] __________________
[gw0] linux -- Python 3.9.18 /home/runner/micromamba/envs/test/bin/python3.9
[XPASS(strict)] categorical dtype not implemented for ADBC postgres driver

@jrmylow jrmylow closed this Jan 23, 2024
@jrmylow jrmylow force-pushed the 2024-01-11-fix_56147 branch from cd52274 to 7281475 Compare January 23, 2024 11:38
@jrmylow
Copy link
Contributor Author

jrmylow commented Jan 23, 2024

whoops I didn't mean to delete that, will try to rectify

@jrmylow jrmylow reopened this Jan 23, 2024
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Feb 28, 2024
@MarcoGorelli
Copy link
Member

this is probably fine, I just haven't had a chance yet to check how (in?)consistently negative ranges are currently handled. I'm aiming to get this in by 3.0 if it's ready

@MarcoGorelli MarcoGorelli changed the title BUG fix for date_range 56147 BUG: Negative freq in date_range produces values out of start and endpoints Feb 29, 2024
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

I think you're right, this is the fix

could you add a whatsnew note for 3.0 please?

could you also update the date_range docs please? they currently don't account for negative frequencies, they just say

Returns the range of equally spaced time points (where the difference between any two adjacent points is specified by the given frequency) such that they all satisfy start <[=] x <[=] end,

If we're changing negative freq behaviour, we need to be very explicit on what the rules are

@jrmylow
Copy link
Contributor Author

jrmylow commented Mar 1, 2024

pre-commit.ci autofix

@MarcoGorelli MarcoGorelli added this to the 3.0 milestone Mar 1, 2024
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

thanks @jrmylow , CI failure is unrelated

@mroeschke mroeschke merged commit 1b84930 into pandas-dev:main Mar 20, 2024
45 of 46 checks passed
@mroeschke
Copy link
Member

Thanks @jrmylow

pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
…points (pandas-dev#56832)

* pandas-dev#56147 negative offset and year end interaction

* pandas-dev#56147 tests

* documentation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixing typing/pylint to mirror other branch

* moved note to Datetimelike

* documentation re-merge

* whatsnew update

* updated date_range docstring

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* reformatted docstring

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update doc/source/whatsnew/v3.0.0.rst

Co-authored-by: Matthew Roeschke <[email protected]>

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Matthew Roeschke <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants