-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: DTA/TDA/PA/Series/Index.view with datetimelike #39788
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
if isinstance(dtype, (np.dtype, ExtensionDtype)) and needs_i8_conversion( | ||
dtype | ||
): | ||
if dtype.kind == "m" and dtype != "m8[ns]": |
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.
you can handle all m and M types via this branch?
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.
L757-L759 is for non-nano td64. L754-L765 handles all td64, dt64, dt64tz, and perioddtype
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 think this could use a little more commentary here (similar to what you did on the datetimelike astype), pls catch in a followon
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.
small comment, other lgtm.
if dtype is None or dtype is self.dtype: | ||
return type(self)(self._ndarray, dtype=self.dtype) | ||
|
||
if isinstance(dtype, type): |
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 think make this clear that M8[ns] (or really M8[s]) or whatever will hit here, but a tz-aware / pandas dtype will pass thru. yes after i read it i get it, but in 3 months no-one will remember.
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.
fleshing out the comment bc its pretty weird. this line isnt catching np.dtype, its catching type, e.g. we get here with dtype=np.ndarray
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.
updated + green
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.
comment for followon
if isinstance(dtype, (np.dtype, ExtensionDtype)) and needs_i8_conversion( | ||
dtype | ||
): | ||
if dtype.kind == "m" and dtype != "m8[ns]": |
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 think this could use a little more commentary here (similar to what you did on the datetimelike astype), pls catch in a followon
This makes it feasible to share some of the SetitemCastingEquivalents tests.