Skip to content

DEPR: Enforce deprecation of na_sentinel #49402

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

Merged
merged 12 commits into from
Nov 7, 2022

Conversation

rhshadrach
Copy link
Member

@rhshadrach rhshadrach commented Oct 30, 2022

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

cc @jbrockmendel @jorisvandenbossche

@rhshadrach rhshadrach added Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Deprecate Functionality to remove in pandas labels Oct 30, 2022
@rhshadrach rhshadrach added this to the 2.0 milestone Oct 30, 2022
@mroeschke
Copy link
Member

Error: /home/runner/work/pandas/pandas/pandas/core/base.py:1139:GL03:pandas.Series.factorize:Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
Error: /home/runner/work/pandas/pandas/pandas/core/algorithms.py:586:GL03:pandas.factorize:Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
Error: /home/runner/work/pandas/pandas/pandas/core/base.py:1139:GL03:pandas.Index.factorize:Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup. LGTM

@mroeschke
Copy link
Member

@rhshadrach heads up - there's a merge conflict

…rce_depr_na_sentinel

� Conflicts:
�	doc/source/whatsnew/v2.0.0.rst
@rhshadrach
Copy link
Member Author

Thanks @mroeschke, it's now resolved.

@jbrockmendel
Copy link
Member

circleCI failure looks like its the float->dt64 astype issue, i.e. unrelated

# We've already warned above
warnings.filterwarnings("ignore", ".*use_na_sentinel.*", FutureWarning)
codes, uniques = values.factorize(na_sentinel=na_sentinel_arg)
# GH#46910 - TimelikeOps has deprecated signature
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it not deprecated there too?

Copy link
Member Author

@rhshadrach rhshadrach Nov 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, missed this one. The deprecation of TimelikeOps signature is taken care of here (in datetimelike.py), just the comment got left behind.

@@ -454,24 +450,6 @@ def __ne__(self, other: Any) -> ArrayLike: # type: ignore[override]
"""
return ~(self == other)

def __init_subclass__(cls, **kwargs) -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow didn't realize we had done this. will be nice to see this go

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! This is indeed nice to see go ;)

@mroeschke
Copy link
Member

@rhshadrach looks like there's a merge conflict; otherwise, looks good to merge

@mroeschke mroeschke merged commit ed1d1f9 into pandas-dev:main Nov 7, 2022
@mroeschke
Copy link
Member

Thanks @rhshadrach

@rhshadrach rhshadrach deleted the enforce_depr_na_sentinel branch November 8, 2022 02:33
phofl pushed a commit to phofl/pandas that referenced this pull request Nov 9, 2022
* DEPR: Enforce deprecation of na_sentinel

* Fixups

* Fix docstring

* Update doc/source/whatsnew/v2.0.0.rst

Co-authored-by: Matthew Roeschke <[email protected]>

* Remove comment

Co-authored-by: Matthew Roeschke <[email protected]>
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
* DEPR: Enforce deprecation of na_sentinel

* Fixups

* Fix docstring

* Update doc/source/whatsnew/v2.0.0.rst

Co-authored-by: Matthew Roeschke <[email protected]>

* Remove comment

Co-authored-by: Matthew Roeschke <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Deprecate Functionality to remove in pandas Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants