Skip to content

CLN: simplify MultiIndex._shallow_copy #27187

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

Merged
merged 2 commits into from
Jul 4, 2019

Conversation

topper-123
Copy link
Contributor

@topper-123 topper-123 commented Jul 2, 2019

MultiIndex._shallow_copy doesnt pass on kwargs, unless values is passed also, but just silently drops the kwargs. This makes _shallow_copy currently a bit unreliable.

This PR fixes that problem by calling .copy directly and passing kwargs to copyand not passing the call through .view. Also, _shallow_copy doesn't call .view on other index types, so this PR makes MultiIndex._shallow_copy conform with other index types.

@topper-123 topper-123 force-pushed the MultiIndex._shallow_copy branch from 6cadc23 to e423c27 Compare July 3, 2019 17:02
@jreback
Copy link
Contributor

jreback commented Jul 3, 2019

this looks ok. does this close any current issues?

does this have any user facing effects?

@topper-123
Copy link
Contributor Author

topper-123 commented Jul 3, 2019

No, there's no issue for this, as this is small & internal. For an upcoming PR I need to call mi._shallow_copy(names=...), so made a separate PR for this, instead of mixing it in the other PR.

This has no user-facing effects.

@topper-123 topper-123 force-pushed the MultiIndex._shallow_copy branch from b82e7bf to 2e84323 Compare July 3, 2019 23:08
@topper-123 topper-123 added this to the 0.25.0 milestone Jul 3, 2019
@jreback
Copy link
Contributor

jreback commented Jul 3, 2019

No, there's no issue for this, as this is small & internal. For an upcoming PR I need to call mi._shallow_copy(names=...), so made a separate PR for this, instead of mixing it in the other PR.

This has no user-facing effects.

k thanks

@jreback jreback merged commit b3d3ce7 into pandas-dev:master Jul 4, 2019
@jreback
Copy link
Contributor

jreback commented Jul 4, 2019

thanks @topper-123

@topper-123 topper-123 deleted the MultiIndex._shallow_copy branch July 4, 2019 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants