Skip to content
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

requested edit to comparison method #27873

Merged
merged 1 commit into from
Aug 13, 2019
Merged

Conversation

jbrockmendel
Copy link
Member

cc @jorisvandenbossche discussed in #27803

@TomAugspurger TomAugspurger added this to the 1.0 milestone Aug 12, 2019
@jreback jreback added the Reshaping Concat, Merge/Join, Stack/Unstack, Explode label Aug 13, 2019
@jreback jreback merged commit eddeee5 into pandas-dev:master Aug 13, 2019
@jreback
Copy link
Contributor

jreback commented Aug 13, 2019

thanks, ideally add to this to a todo list

@jorisvandenbossche
Copy link
Member

@jreback if it is a PR specifically for my comments, can you please give me a bit of time to review it?

There were actually more things we were discussing than this.

@jreback
Copy link
Contributor

jreback commented Aug 13, 2019

sure

@jorisvandenbossche
Copy link
Member

@jbrockmendel what I wanted to ask in addition:

  • can you add a test (for a non-frozenset case) for a case that would have broken by the previous PR?
  • can update the wrong "# rename is needed in case res_name is None and result.name" comment?
  • ideally, can you also do the rename only if needed? (or use a cheaper method that does not copy)

@jbrockmendel
Copy link
Member Author

jbrockmendel commented Aug 14, 2019

can you add a test (for a non-frozenset case) for a case that would have broken by the previous PR?

I'd rather not test not-necessarily-intentional behavior until we pin down the desired behavior in #27911

can update the wrong "# rename is needed in case res_name is None and result.name" comment?

Sure.

ideally, can you also do the rename only if needed? (or use a cheaper method that does not copy)

Doesn't it do a shallow copy? I guess creating a new Series object is more costly than the check in the case where it isnt needed? Wouldn't it be cheaper yet to unconditionally just set result.name = res_name?

@jorisvandenbossche
Copy link
Member

I'd rather not test not-necessarily-intentional behavior

Well, it's working behaviour that people will rely upon, so we shouldn't just break it IMO. So in that case a test would be useful. It would eg have catched the changes you were doing in the previous PR, and will do if you or someone further work on that code in the future (we are now well aware, but if we only pick it up again in some months, we might well have forgotten again)

Doesn't it do a shallow copy?

Nope, it returns a new object, which currently means copying the data (we don't yet have a copy-on-write)

@jorisvandenbossche
Copy link
Member

Well, it's working behaviour that people will rely upon, so we shouldn't just break it IMO.

But will take a look at the issue you linked

@jorisvandenbossche
Copy link
Member

I'd rather not test not-necessarily-intentional behavior

And it would also have helped to catch https://github.com/pandas-dev/pandas/pull/27769/files#r314060256 :-)

quintusdias pushed a commit to quintusdias/pandas_dev that referenced this pull request Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants