Skip to content

DOC: #38067 add missing holiday observance rules #57939

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

Conversation

dontgoto
Copy link
Contributor

@dontgoto dontgoto commented Mar 20, 2024

Updated docs with missing functions.

weekend_to_monday and next_monday do indeed do the exact same thing, and I agree that next_monday should be deprecated. Any thoughts?

@dontgoto dontgoto changed the title #38067 add missing holiday observance rules DOC: #38067 add missing holiday observance rules Mar 21, 2024
@mroeschke mroeschke added the Docs label Mar 21, 2024
@mroeschke mroeschke added this to the 3.0 milestone Mar 21, 2024
@mroeschke mroeschke merged commit 97c3a45 into pandas-dev:main Mar 21, 2024
50 checks passed
@mroeschke
Copy link
Member

Thanks @dontgoto

weekend_to_monday and next_monday do indeed do the exact same thing, and I agree that next_monday should be deprecated. Any thoughts?

Yeah that makes sense to deprecate one of them if they are redundant

@dontgoto
Copy link
Contributor Author

Yeah that makes sense to deprecate one of them if they are redundant

Can I put in a deprecation notice for 4.0.0? Or something like that?

@Jeitan
Copy link

Jeitan commented Mar 21, 2024

My two cents here - I think "weekend_to_monday" is more accurate and descriptive, BUT if that's the one we keep it would make the most sense to also change the current "previous_friday" to "weekend_to_friday". I think it's clearest to keep the before/after and next/previous pairs as matched as possible ... so whichever gets deprecated, the pair should be either:

  • weekend_to_monday and weekend_to_friday
  • next_monday and previous_friday

I prefer the former but wouldn't care too much if folks prefer the latter.

@dontgoto
Copy link
Contributor Author

  • weekend_to_monday and weekend_to_friday

  • next_monday and previous_friday

I find the former function names make more sense , because in the end they only shift when on a weekend, the latter implies that weekdays are also shifted, but they're not.

On the other hand, the latter ones have been in the user guide since forever, the former ones not.

@@ -1468,11 +1468,16 @@ or some other non-observed day. Defined observance rules are:
:header: "Rule", "Description"
:widths: 15, 70

"next_workday", "move Saturday and Sunday to Monday"
"previous_workday", "move Saturday and Sunday to Friday"
Copy link

@Jeitan Jeitan Mar 22, 2024

Choose a reason for hiding this comment

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

This one for 'previous workday' isn't quite right ... it moves to the previous workday even if the input is a weekday, not just for Sat and Sun (as opposed to what previous_friday does)

@Jeitan
Copy link

Jeitan commented Mar 22, 2024

@dontgoto I agree on the "makes more sense" ... even though the others have been documented I think that can be got around by deprecating them for a while before they go away

pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
…v#57939)

* fix method docstrings

* add observances to user guide

* add weekend_to_monday to user guide
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.

DOC: Include missing holiday observance rules
3 participants