Skip to content

DEPR: making copies when indexing along columns #36105

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

Closed
wants to merge 20 commits into from

Conversation

jbrockmendel
Copy link
Member

xref #33597 for what this might look like once the deprecation is enforced (nice perf bump)

cc @jorisvandenbossche my understanding is that we will need this deprecation for the all-1D world too. Is that correct? Any thoughts on nice ways to test this and avoid putting tm.assert_produces_warning in a zillion places across the code?

jbrockmendel and others added 20 commits August 20, 2020 21:19
@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Sep 4, 2020

my understanding is that we will need this deprecation for the all-1D world too. Is that correct?

We don't have to (I mean it's not tied to being 1D), but yes, I suppose we will want that to return views in the long term (although there wasn't much discussion around it in the issue).

Any thoughts on nice ways to test this and avoid putting tm.assert_produces_warning in a zillion places across the code?

This also indicates that users will see a zillion of such warnings .. Also, what is the way for users to silence the warning?
So therefore, I am not really sure we should already start doing that now. Certainly because in many cases it won't actually matter for their code. The other option is to "simply" make a breaking change for pandas 2.0.

@jbrockmendel
Copy link
Member Author

The other option is to "simply" make a breaking change for pandas 2.0

Is there precedent for this? Per #33597, I'm OK with just making the switch immediately.

This also indicates that users will see a zillion of such warnings .. Also, what is the way for users to silence the warning?

Good question. I guess we'd have to give a way to opt in to the always-view behavior, or maybe a global flag to silence the warning. Neither is particularly pretty.

@jorisvandenbossche
Copy link
Member

What do you mean with precedent? (what kind of precedent are you looking for in this case?)

@jbrockmendel
Copy link
Member Author

What do you mean with precedent? (what kind of precedent are you looking for in this case?)

Changes that would require a deprecation cycle being made without one

@jorisvandenbossche
Copy link
Member

Ah, we certainly have that ;) Check the sections "Backwards incompatible API changes" in all previous releases?

@jbrockmendel
Copy link
Member Author

makes sense, thanks

@jbrockmendel jbrockmendel deleted the depr-index-view branch November 20, 2021 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API: Should indexing on columns give views or copies?
4 participants