-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REF: Simplify Index.copy #35592
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
REF: Simplify Index.copy #35592
Conversation
I`ve added tests. |
lgtm ping on green. |
Hello @topper-123! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-08-08 15:43:16 UTC |
c3a5997
to
bbfbda1
Compare
pandas/core/dtypes/common.py
Outdated
@@ -1732,6 +1732,32 @@ def _validate_date_like_dtype(dtype) -> None: | |||
) | |||
|
|||
|
|||
def validate_all_hashable(*args, error_name=None) -> 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.
can you type error_name
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.
Updated. |
63f019b
to
c78d99e
Compare
thanks @topper-123 |
Avoid the use of the
Index.set_names
inIndex.copy
, which is a slightly awkward method to use here (it calls_shallow_copy
+ is longwinded).This is archieved by tightening up the checks in
_validate_names
.