BUG: Series.map is ignoring the na_action keyword · Issue #46588 · pandas-dev/pandas (original) (raw)

Pandas version checks

Reproducible Example

import pandas as pd a = pd.Series([pd.NA, 1, 1, pd.NA]) a.map({1:2, pd.NA:3}, na_action=True)

Issue Description

This code should throw an error because na_action is invalid, but instead I've gotten a Jupyter notebook, ipython in Powershell, and an online interpreter to generate the following output

0    3
1    2
2    2
3    3
dtype: int64

I get the same output for na_action='ignore' and na_action=None

Expected Behavior

ValueError: na_action must either be 'ignore' or None, True was passed

Installed Versions

INSTALLED VERSIONS ------------------ commit : 06d2301python : 3.9.12.final.0 python-bits : 64 OS : Windows OS-release : 10 Version : 10.0.22000 machine : AMD64 processor : Intel64 Family 6 Model 141 Stepping 1, GenuineIntel byteorder : little LC_ALL : None LANG : None LOCALE : English_United States.1252

pandas : 1.4.1
numpy : 1.22.3
pytz : 2021.3
dateutil : 2.8.2
pip : 22.0.4
setuptools : 58.1.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.3
IPython : 7.30.1
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : 1.4.28
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
zstandard : None