-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: Deprecate Series.view #56054
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 Series.view #56054
Changes from 10 commits
3ad7148
f82034d
b66c3a9
e33095c
38379ac
7854092
aa8809a
b3a85f3
e5d525c
4e42dd9
d9d6faa
f98743f
81a3356
c64dca9
ef1290e
8bd7b39
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 | ||||
---|---|---|---|---|---|---|
|
@@ -938,6 +938,11 @@ def view(self, dtype: Dtype | None = None) -> Series: | |||||
4 2 | ||||||
dtype: int8 | ||||||
""" | ||||||
warnings.warn( | ||||||
"Series.view is deprecated and will be removed in a future version.", | ||||||
FutureWarning, | ||||||
stacklevel=find_stack_level(), | ||||||
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.
Suggested change
(see my comment on the ravel PR at #56053 (comment)) 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. Done |
||||||
) | ||||||
# self.array instead of self._values so we piggyback on NumpyExtensionArray | ||||||
# implementation | ||||||
res_values = self.array.view(dtype) | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,10 @@ | |
) | ||
import pandas.core.common as com | ||
|
||
pytestmark = pytest.mark.filterwarnings( | ||
"ignore:Series.view is deprecated and will be removed in a future version.:FutureWarning" # noqa: E501 | ||
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. This seems a bit a "dangerous" ignore, because we want to be sure the algos itself aren't raising the warning, and algos seems a part of the codebase that is using 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. I can ignore them specifically, will update later |
||
) | ||
|
||
|
||
class TestFactorize: | ||
def test_factorize_complex(self): | ||
|
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.
Point to astype instead if the goal was to change the dtype?
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.
Yeah