-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: preserve non-nano DTA/TDA in Index/Series/DataFrame #47230
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
Looks really cool. Not sure if for the tests I'd compare to the literal of the dtype we expect. We're testing that the type of the array are preserved. This could be tested in general (not sure if it is), but feels a bit strange that this is done in the tests specific to non-nano, instead of making sure the dtype is the non-nano we want. Not important, just sharing, if you like this approach better, is fine with me. I guess we're testing the dtype of the array elsewhere already. |
@@ -537,15 +537,16 @@ def treat_as_nested(data) -> bool: | |||
# --------------------------------------------------------------------- | |||
|
|||
|
|||
def _prep_ndarray(values, copy: bool = True) -> np.ndarray: | |||
def _prep_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.
maybe rename to prep_array_like or similar?
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.
Looks fairly good. Just needs a rebase
Thanks @jbrockmendel |
…47230) * ENH: preserve non-nano DTA/TDA in Index/Series/DataFrame * tighten xfail * _prep_ndarray->_prep_ndarraylike * xfail non-strict
Continue to cast non-nano ndarrays, but if a user goes out of there way to create a non-nano DTA/TDA, preserve it in the other constructors.