Skip to content
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

DEPR: special-casing dt64/td64 in Series.unique #42741

Closed
wants to merge 2 commits into from

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Jul 26, 2021

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry
dti = pd.date_range('2016-01-01', periods=3).repeat(2)
ser = pd.Series(dti)

>>> ser.unique()
<stdin>:1: FutureWarning: Series.unique behavior with datetime64[ns] dtype is deprecated. In a future version this will return a <class 'pandas.core.arrays.datetimes.DatetimeArray'> instead of a np.ndarray
array(['2016-01-01T00:00:00.000000000', '2016-01-02T00:00:00.000000000',
       '2016-01-03T00:00:00.000000000'], dtype='datetime64[ns]')

@jreback jreback added Deprecate Functionality to remove in pandas Datetime Datetime data dtype labels Jul 28, 2021
@jreback
Copy link
Contributor

jreback commented Jul 28, 2021

can you add a release note. IIUC this will always warn? how does one avoid this?

@jbrockmendel
Copy link
Member Author

IIUC this will always warn? how does one avoid this?

i guess could do ._values.unique

@jreback
Copy link
Contributor

jreback commented Aug 5, 2021

i am confused over when the user would see this, can you update the top of the PR

@jbrockmendel
Copy link
Member Author

added example to OP

@jreback
Copy link
Contributor

jreback commented Aug 7, 2021

so the problem is this will always warn right?

@jbrockmendel
Copy link
Member Author

jbrockmendel commented Aug 8, 2021 via email

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2021

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

@jreback
Copy link
Contributor

jreback commented Nov 28, 2021

@jbrockmendel worth fixing this up?

@jbrockmendel
Copy link
Member Author

worth fixing this up?

i think this is worth doing. IIRC the trouble was that if we issue a FutureWarning, we don't have a good way to say "do X instead to get the future behavior". Best idea ATM is to just make the change in 2.0 without a deprecation cycle.

@jreback
Copy link
Contributor

jreback commented Nov 28, 2021

yeah sounds good to me

@jreback jreback added this to the 2.0 milestone Nov 28, 2021
@jreback
Copy link
Contributor

jreback commented Jan 16, 2022

@jbrockmendel this for 2.0? if so let's just close it (and add to the list itself which i think you did)

@jbrockmendel
Copy link
Member Author

this for 2.0? if so let's just close it (and add to the list itself which i think you did)

sure.

@jbrockmendel jbrockmendel added the Mothballed Temporarily-closed PR the author plans to return to label Jan 16, 2022
@jbrockmendel jbrockmendel deleted the depr-unique-mM branch October 18, 2022 22:31
@jbrockmendel jbrockmendel removed the Mothballed Temporarily-closed PR the author plans to return to label Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Deprecate Functionality to remove in pandas Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants