Skip to content

STYLE sort whatsnew entries alphabeticaly, allow for trailing full stops #52598

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 5 commits into from
Apr 13, 2023

Conversation

MarcoGorelli
Copy link
Member

This came up in #52214 - cc @rhshadrach

@MarcoGorelli MarcoGorelli changed the title allow for trailing full stops in sort-whatsnew-entries hook STYLE allow for trailing full stops in sort-whatsnew-entries hook Apr 11, 2023
@MarcoGorelli MarcoGorelli requested a review from rhshadrach April 11, 2023 15:45
@MarcoGorelli MarcoGorelli added the Code Style Code style, linting, code_checks label Apr 11, 2023
@phofl
Copy link
Member

phofl commented Apr 11, 2023

The sorting become bothersome while fixing regressions. It blocks more or less every pr of mine. Not sure what others think about it

cc @mroeschke @jbrockmendel

@jbrockmendel
Copy link
Member

maybe it is more troublesome on backport PRs that tend to have very-recent issue numbers? i haven't found it to be a pain point in general (nor have i found it to significantly decrease merge conflicts which IIRC was a big motivator)

@phofl
Copy link
Member

phofl commented Apr 11, 2023

Yeah probably, but we didn't get many merge conflicts in the 1.x release notes anyway and the 1.x.y notes tend to be ordered because we are fixing bugs as they come in if possible

@rhshadrach
Copy link
Member

Thanks @MarcoGorelli - I'm guessing we'll be chasing some ill formatting every once in a while but I'm still positive on seeing how this goes.

The sorting become bothersome while fixing regressions. It blocks more or less every pr of mine.

Is the sorting making things worse, or is it just not helping?

@mroeschke
Copy link
Member

mroeschke commented Apr 12, 2023

I think lately as there are more PRs addressing 2.0.x regressions, multiple open PRs have their whatsnew entry at the end of a section due to the hook, then when one is merged the others have merge conflicts

@MarcoGorelli
Copy link
Member Author

I think the issue with backports is the 2.0.x branch doesn't have this hook

One simple solution could be to just add this hook to the 2.0.x branch, which should address the problem (thanks for having brought this up! It was meant to help, and if it's not doing that, then that's an issue). @phofl any objections to that?

@phofl
Copy link
Member

phofl commented Apr 12, 2023

The main problem are the conflicts when merging into main, the actual backports aren’t a problem right now since we can’t merge more than one pr anyway before we have to rebase

@MarcoGorelli
Copy link
Member Author

I don't follow - if it happens when merging to main, when why do you mention regressions? Wouldn't that happen for any PR (regression or not)?

I'm surprised anyway - could you please tag me in a PR next time it happens please? Hoping this is salvageable

@phofl
Copy link
Member

phofl commented Apr 12, 2023

As @mroeschke said, we are fixing the regressions as they come in, which means that all the whatsnews are at the end of one section, e.g. if you merge a pr all other prs that would add a note to the end of the section are blocked.

#52577

This one got blocked by another pr that was merged tonight. The same happens for most prs that target 2.0.1

@MarcoGorelli
Copy link
Member Author

thanks

which means that all the whatsnews are at the end of one section

Isn't this what we always used to do before the script anyway? How does the script affect it? Where would you have put the whatsnew entry if the script wasn't there?

@phofl
Copy link
Member

phofl commented Apr 12, 2023

I would have alternated between the beginning, end and somewhere in the middle. This works in 99% of the cases as soon as we have a couple of notes

@MarcoGorelli
Copy link
Member Author

ah, I see. yeah if you were already putting the entry a bit at random, then the script would indeed make things worse. I thought everyone was always adding entries to the end

🤔 maybe there's another ordering we can use, which would:

  • not force regressions whatsnews entries to all be piled up at the end
  • prevent everyone from adding whatsnews entries to the end (which is what used to cause all the conflicts)

@MarcoGorelli MarcoGorelli changed the title STYLE allow for trailing full stops in sort-whatsnew-entries hook STYLE sort whatsnew entries alphabeticaly, allow for trailing full stops Apr 12, 2023
@MarcoGorelli
Copy link
Member Author

How about if we sort alphabetically? I'd expect this to solve the issues, and whatsnew conflicts are pretty common

Else I don't mind removing it, I'm not that attached to it

@phofl
Copy link
Member

phofl commented Apr 12, 2023

I don't know, I barely had conflicts before we introduced the sorting (only when whatsnew was basically empty, but this can't be solved by any sorting mechanism).

@MarcoGorelli
Copy link
Member Author

I barely had conflicts before we introduced the sorting

is this because you would insert whatsnew entries in random places, rather than always at the end (like most people seem to)? because I do see it come up a fair bit, and have heard so from others too

@phofl
Copy link
Member

phofl commented Apr 12, 2023

Yeah I almost never insert at the end

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

lgtm, except for - ironically - the whatsnew conflicts 😆

@MarcoGorelli
Copy link
Member Author

😄

have fixed up, with:

 2005  git merge upstream/main
 2006  git checkout upstream/main -- doc/source/
 2007  pre-commit run sort-whatsnew-items -a
 2008  git add -u
 2009  git merge --continue
 2010  git push origin HEAD

OK to merge before other conflicts creep in?

Thanks all for your patience here, if this works I'm confident it'll help in the long-run

@mroeschke mroeschke added this to the 2.0.1 milestone Apr 13, 2023
@mroeschke mroeschke removed this from the 2.0.1 milestone Apr 13, 2023
@mroeschke mroeschke added this to the 2.1 milestone Apr 13, 2023
@mroeschke mroeschke merged commit bd5ed2f into pandas-dev:main Apr 13, 2023
@mroeschke
Copy link
Member

Thanks @MarcoGorelli

Mind manually creating a PR against the 2.0.x branch adjusting v2.0.1.rst whatsnew to how it's structured here?

mroeschke added a commit to mroeschke/pandas that referenced this pull request Apr 13, 2023
…ops (pandas-dev#52598)

* allow for trailing full stops in sort-whatsnew-entries hook

* sort alphabetically instead

---------

Co-authored-by: MarcoGorelli <>
@MarcoGorelli
Copy link
Member Author

yup, doing it now

mroeschke added a commit that referenced this pull request Apr 14, 2023
* BUG: dt.days for timedelta non-nano overflows int32

* Run precommit

* lint

* Address code check failures

* Add whatsnew

* PERF: numpy dtype checks (#52582)

* CLN: Use #pragma once instead of include guards (#52635)

Use #pragma once

* Refactored custom datetime functions (#52634)

refactored custom datetime functions

* BLD: Add DLL hashes to RECORD (#52556)

* CI: Remove ArrayManager job (#52637)

* DOC: Remove notes to old Python/package versions (#52640)

* STYLE sort whatsnew entries alphabeticaly, allow for trailing full stops (#52598)

* allow for trailing full stops in sort-whatsnew-entries hook

* sort alphabetically instead

---------

Co-authored-by: MarcoGorelli <>

* Fix redundant entries

* remove redundant entries

---------

Co-authored-by: jbrockmendel <[email protected]>
Co-authored-by: William Ayd <[email protected]>
Co-authored-by: Thomas Li <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants