-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: type argument in Index.view #56421
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
Conversation
Didn't we want to deprecate this entire method or was that just Series.view? |
i tried deprecating the whole method and there were some fiddly |
Thanks @jbrockmendel |
@@ -1012,6 +1012,16 @@ def view(self, cls=None): | |||
|
|||
result = self._data.view(cls) | |||
else: | |||
if cls is not None: |
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.
There is still a if cls is not None and not hasattr(cls, "_typ"):
branch above, should passing cls
for those cases also be deprecated?
(otherwise we still can't remove the keyword after the current deprecation of this PR is enforced?)
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.
This deprecated passing a type index.view(pd.DatetimeIndex)
, didnt handle passing a 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.
OK, I see. But do you know of any usage internally with a dtype?
I know we use it regularly without any argument to get an "identical" object (that passes is_
), but I don't directly find much usage with a dtype.
From a quick look (outside of direct tests for this), I only found CategoricalDtype._hash_categories
that uses it, where it could easily be avoided.
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.
id be fine with follow-up(s) to deprecate more/all of this
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.