Skip to content

Conversation

@hamdanal
Copy link
Contributor

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

na_action default to None

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.

I tried your idea myself and found one more unaddressed case.

@hamdanal
Copy link
Contributor Author

Looks like the overloads are not actually needed. I simplified the stub and added the tests you suggested.

@cmp0xff
Copy link
Contributor

cmp0xff commented Nov 30, 2025

Looks like the overloads are not actually needed. I simplified the stub and added the tests you suggested.

Removing the overloads is a bit alerting. I've come up with the following examples.

>>> import pandas as pd
>>> pd.Series([1, 2, 3]).map({1: "a", 2: 1.5})
0      a
1    1.5
2    NaN
dtype: object
>>> pd.Series([1, "a"]).map({1: 1.0, "a": 2.0})
0    1.0
1    2.0
dtype: float64

The first case is pd.Series[int] becoming pd.Series[Any]. The second case is pd.Series[Any] becoming pd.Series[float]. Could you include them in the test?

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