Skip to content

Conversation

@MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Nov 3, 2025

closes #1444

  • Closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added: Please use assert_type() to assert the type of any return value

@cmp0xff
Copy link
Contributor

cmp0xff commented Nov 3, 2025

Just a kind reminder: please remove

"*series.pyi" = [
  # TODO: remove when pandas-dev/pandas-stubs#1444 is resolved
  "ANN001", "ANN201", "ANN204", "ANN206",
]

from pyproject.toml when this is ready. Thanks.

@MarcoGorelli MarcoGorelli marked this pull request as ready for review November 3, 2025 15:18
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.

One question.

@cmp0xff cmp0xff added the Series Series data structure label Nov 4, 2025
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.

There is room to improve. Examples:

  • __getitem__ and __setitem__ are duplicated. I think we can make @type_check_only classes to deduplicate.
  • pd.Series([1, 2]).iloc[pd.Series([1])] seems to work, so idx in __setitem__ can also be Series, it seems to me
  • Index | Series may be worthy to combine into IndexOpsMixin

Overall, the PR does what it should - adding types to Series. I'll give green light. The new ideas can be addressed in a separate PR with new tests. Thank you @MarcoGorelli !

@cmp0xff cmp0xff merged commit ca481c6 into pandas-dev:main Nov 4, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Series Series data structure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typing Series

3 participants