-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: Deprecate the convert parameter completely #17831
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -528,28 +528,27 @@ def _compare(idx): | |
exp = pd.Series(np.repeat(nan, 5)) | ||
tm.assert_series_equal(sp.take([0, 1, 2, 3, 4]), exp) | ||
|
||
with tm.assert_produces_warning(FutureWarning): | ||
sp.take([1, 5], convert=True) | ||
|
||
with tm.assert_produces_warning(FutureWarning): | ||
sp.take([1, 5], convert=False) | ||
|
||
def test_numpy_take(self): | ||
sp = SparseSeries([1.0, 2.0, 3.0]) | ||
indices = [1, 2] | ||
|
||
# gh-17352: older versions of numpy don't properly | ||
# pass in arguments to downstream .take() implementations. | ||
warning = FutureWarning if _np_version_under1p12 else None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason this is not the case anymore? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, I need to put that back. However, I different default will be needed, as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the problem with None for numpy? You linked to a sparse failure, but in the sparse code you left the default as None. If it is needed, another solution might be to push it into the kwargs? (so the -1 is not visible) BTW, can you push new commits instead of squashing into the previous one? That makes it easier to say what you changed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, sorry, missed your message before I pushed. The problem is that |
||
|
||
with tm.assert_produces_warning(warning, check_stacklevel=False): | ||
if not _np_version_under1p12: | ||
tm.assert_series_equal(np.take(sp, indices, axis=0).to_dense(), | ||
np.take(sp.to_dense(), indices, axis=0)) | ||
|
||
msg = "the 'out' parameter is not supported" | ||
tm.assert_raises_regex(ValueError, msg, np.take, | ||
sp, indices, out=np.empty(sp.shape)) | ||
msg = "the 'out' parameter is not supported" | ||
tm.assert_raises_regex(ValueError, msg, np.take, | ||
sp, indices, out=np.empty(sp.shape)) | ||
|
||
msg = "the 'mode' parameter is not supported" | ||
tm.assert_raises_regex(ValueError, msg, np.take, | ||
sp, indices, mode='clip') | ||
msg = "the 'mode' parameter is not supported" | ||
tm.assert_raises_regex(ValueError, msg, np.take, | ||
sp, indices, out=None, mode='clip') | ||
|
||
def test_setitem(self): | ||
self.bseries[5] = 7. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TomAugspurger prob just as easy to fix this on merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can fix that in #17858
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, why do you say that's leftover? Wasn't that added deliberately @gfyoung?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually nvm thought was a different comment