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: remove get_values, SparseArray.values #29989

Merged
merged 10 commits into from
Dec 4, 2019

Conversation

jbrockmendel
Copy link
Member

The cleanups in libreduction are made possible by SparseArray.values going away.

@gfyoung gfyoung added Clean Sparse Sparse Data Type Deprecate Functionality to remove in pandas labels Dec 3, 2019
@gfyoung
Copy link
Member

gfyoung commented Dec 3, 2019

I would have thought these changes would have been fine...just need to diagnose the CI failures.

stacklevel=2,
)
return self._internal_get_values()

def _internal_get_values(self):
Copy link
Member

Choose a reason for hiding this comment

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

Can you add part of the above docstring to this method? (the interesting parts for internal use, eg what it returns)

(and potentially the same comment for some of the other cases below)

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea

@WillAyd
Copy link
Member

WillAyd commented Dec 3, 2019

I think there is some JSON code that can get cleaned up as part of this:

// TODO can be removed again once SparseArray.values is removed (GH26421)

@jbrockmendel
Copy link
Member Author

I think there is some JSON code that can get cleaned up as part of this:

Nice. Want me to do that here or save for follow-up?

@WillAyd
Copy link
Member

WillAyd commented Dec 3, 2019

Up to you

@jorisvandenbossche
Copy link
Member

I think there is some JSON code that can get cleaned up as part of this:

Nice. Want me to do that here or save for follow-up?

Let's do that here I would say, it's from the same PR that deprecated SparseArray.values: #26421 (you are already removing part of the things of that PR that can be removed)

@jreback jreback added this to the 1.0 milestone Dec 4, 2019
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

lgtm. ping when ready (if addressing JSON things)

@@ -5500,7 +5497,7 @@ def get_values(self):
0 1 True 1.0
1 2 False 2.0

>>> df.get_values()
>>> df._internal_get_values()
Copy link
Contributor

Choose a reason for hiding this comment

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

i would just remove these examples as they are no longer relevant

@jbrockmendel
Copy link
Member Author

removed examples from docstring, left the json since it wasnt obvious what to do in the places where is_sparse_array is currently called

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

lgtm

@jorisvandenbossche
Copy link
Member

left the json since it wasnt obvious what to do in the places where is_sparse_array is currently called

From looking at my old PR, I think you can just remove the is_sparse_array where it is used (so change it back to how it was before that PR). SparseArray won't have a values attribute anymore, so that check will work fine now (and not trigger a warning).

@jbrockmendel
Copy link
Member Author

removed is_sparse_array, green

@WillAyd WillAyd merged commit 80a4156 into pandas-dev:master Dec 4, 2019
@WillAyd
Copy link
Member

WillAyd commented Dec 4, 2019

Thanks @jbrockmendel

proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Deprecate Functionality to remove in pandas Sparse Sparse Data Type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants