-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ERR: Raise on invalid na_action in Series.map #32790
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
Conversation
Do any Index methods need the same fix? |
Looks like they do. Actually it seems worse, e.g. Edit: Tried fixing this and wasn't able to without introducing more bugs. Opened this issue instead: #32815. |
pandas/core/base.py
Outdated
map_f = lib.map_infer | ||
else: | ||
raise ValueError("na_action must either be 'ignore' or None") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add: f`{na_action}
was passed
@@ -787,3 +787,9 @@ def test_map_float_to_string_precision(self): | |||
result = ser.map(lambda val: str(val)).to_dict() | |||
expected = {0: "0.3333333333333333"} | |||
assert result == expected | |||
|
|||
def test_map_with_invalid_na_action_raises(self): | |||
s = pd.Series([1, 2, 3]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the issue umber as a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. merge master and ping on green.
@jreback Merged master and green, thanks for reviewing |
thanks |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Series.map
treats anyna_action
other than"ignore"
likeNone
, but it should probably raise if someone provides an invalid option: