-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: deprecate (Sparse)Series.from_array #18258
DEPR: deprecate (Sparse)Series.from_array #18258
Conversation
pandas/core/series.py
Outdated
fastpath=fastpath) | ||
|
||
@classmethod | ||
def _from_array(cls, arr, index=None, name=None, dtype=None, copy=False, |
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.
its prob easier just to elminate this and deal with SparseSeries directly in the Series constructor. Do we have an issue for this?
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.
annoyingly we'd actually have to do this in __new__
(but not that big of a deal)
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, that would be cleaner. But it is also an API change that Series(..)
would no longer always return a Series but depending on the input also SparseSeries.
So the question is if we actually want this. I can open an issue about it though.
Codecov Report
@@ Coverage Diff @@
## master #18258 +/- ##
=========================================
Coverage ? 91.38%
=========================================
Files ? 164
Lines ? 49892
Branches ? 0
=========================================
Hits ? 45594
Misses ? 4298
Partials ? 0
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #18258 +/- ##
=========================================
Coverage ? 91.38%
=========================================
Files ? 164
Lines ? 49888
Branches ? 0
=========================================
Hits ? 45591
Misses ? 4297
Partials ? 0
Continue to review full report at Codecov.
|
thanks! |
@jorisvandenbossche @jreback : This commit introduced the first (and only) instance of |
@gfyoung let's just use |
@jreback : I figured as such. Thanks for confirming. |
Per discussion in pandas-devgh-18258, we are prohibiting its use in tests, at least for the time being.
Per discussion in pandas-devgh-18258, we are prohibiting its use in tests, at least for the time being.
* MAINT: Check for pytest.warns in tests Per discussion in gh-18258, we are prohibiting its use in tests, at least for the time being. * MAINT: Patch lint error with pytest.warns The lint correctly fails on this line.
Closes #18213.
It's a bit annoying that I have to keep it as internal method. On the other hand this might signal that
from_array
actually has some use case ..