Skip to content

Conversation

@MarcoGorelli
Copy link
Member

Series is already Iterable, so Iterable | Series was redundant here

Series.isin doesn't accept dict in the same way that DataFrame.isin does:

  • in the dataframe case, you can pass a per-column mapping

  • in the series one, it accidentally works but just because it's an iterable (i.e., only the keys are checked anyway)

  • Closes #xxxx (Replace xxxx with the Github issue number)

  • Tests added (Please use assert_type() to assert the type of any return value)

  • If I used AI to develop this pull request, I prompted it to follow AGENTS.md.

@MarcoGorelli MarcoGorelli marked this pull request as ready for review November 26, 2025 15:29
Copy link
Contributor

@cmp0xff cmp0xff left a comment

Choose a reason for hiding this comment

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

Thank you @MarcoGorelli (for your patience)!

Edit: sorry I was about to approve, but found a place to work on when I took a second look.

Copy link
Contributor

@cmp0xff cmp0xff left a comment

Choose a reason for hiding this comment

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

Two more comments, after looking into the MultiIndex case more carefully.

Copy link
Contributor

@cmp0xff cmp0xff left a comment

Choose a reason for hiding this comment

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

Thank you @MarcoGorelli ! And sorry for the back and forth. It just happened that I came up with new ideas how to challenge the existing typing and tests.

@cmp0xff cmp0xff merged commit 18626a9 into pandas-dev:main Dec 1, 2025
16 checks passed
@MarcoGorelli
Copy link
Member Author

really appreciate your careful reviews, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants