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

API: Index.intersection sort keyword default different from other set methods #51351

Open
jbrockmendel opened this issue Feb 12, 2023 · 4 comments
Labels
API - Consistency Internal Consistency of API/Behavior setops union, intersection, difference, symmetric_difference

Comments

@jbrockmendel
Copy link
Member

jbrockmendel commented Feb 12, 2023

Index.intersection's sort keyword defaults to False, while others default to None. If there isn't a compelling reason for this difference, we should make these match.

@jbrockmendel jbrockmendel added Bug Needs Triage Issue that has not been reviewed by a pandas team member API - Consistency Internal Consistency of API/Behavior setops union, intersection, difference, symmetric_difference and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 12, 2023
@jbrockmendel jbrockmendel changed the title API: Index.different sort keyword default different from other set methods API: Index.difference sort keyword default different from other set methods Feb 13, 2023
@jbrockmendel
Copy link
Member Author

Looks like this was done intentionally in #25063. @jorisvandenbossche I see in the whatsnew note there an explicit discussion of the default being different, but not a "why". Do you remember the reason for that? This issue might be as easy as a comment

@jbrockmendel
Copy link
Member Author

Changing the default breaks three tests: test_intersection_nosort, test_intersect_with_duplicates, test_concat_inner_sort.

@lukemanley
Copy link
Member

@jbrockmendel - I think you might have intended for this issue to be about Index.intersection rather than Index.difference?

@jbrockmendel jbrockmendel changed the title API: Index.difference sort keyword default different from other set methods API: Index.intersection sort keyword default different from other set methods Sep 12, 2023
@jbrockmendel
Copy link
Member Author

Yep, thanks. Updated the OP and title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Consistency Internal Consistency of API/Behavior setops union, intersection, difference, symmetric_difference
Projects
None yet
Development

No branches or pull requests

2 participants