pandas icon indicating copy to clipboard operation
pandas copied to clipboard

API: Replace na_action parameter in Series/DataFrame/Index.map by the standard skipna

Open datapythonista opened this issue 6 months ago • 1 comments

  • [X] xref #61128
  • [X] Tests added and passed if fixing a bug or adding a new feature
  • [X] All code checks passed.
  • [X] Added type annotations to new arguments/methods/functions.
  • [X] Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

We've been consistently using a boolean skipna parameter to let users decide whether missing values should be ignored or not in different methods. The .map method has an awkward na_action=None | "igonre" for the same purpose. I add the standard skipna parameter to the methods, and start the deprecation of the na_action one.

datapythonista avatar Jun 01 '25 11:06 datapythonista

Updated this so the na_action parameter is also not removed from the extension arrays, and it warns. The base array since as you said @mroeschke is technically public. map_array since it's used by pandas-pint, even if it's not supposed to be public, but better not break their code. And the specific implementations that subclass the base extension array to keep the same signature. mypy complained, and also better to keep the signatures the same even if it's a temporary thing.

I think this should be ready to merge now.

datapythonista avatar Jun 13 '25 23:06 datapythonista

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

github-actions[bot] avatar Jul 25 '25 00:07 github-actions[bot]