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

BUG: binary operations don't propogate attrs depending on order with Series and/or DataFrame/Series #51607

Closed
3 tasks done
mroeschke opened this issue Feb 24, 2023 · 3 comments · Fixed by #59636
Closed
3 tasks done
Assignees
Labels
Bug metadata _metadata, .attrs

Comments

@mroeschke
Copy link
Member

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

In [1]: ser1 = pd.Series(range(1))

In [2]: ser2 = pd.Series(range(1))

In [3]: ser1.attrs = {1:2}

In [4]: val = ser2 + ser1

In [5]: val.attrs
Out[5]: {}

Issue Description

val.attrs should be {1:2}

The relevant tests are xfailed in test_finalize.py::test_binary

Expected Behavior

val.attrs should be {1:2}

Installed Versions

Replace this line with the output of pd.show_versions()

@mroeschke mroeschke added Bug metadata _metadata, .attrs labels Feb 24, 2023
@fridaagronberg
Copy link

take

@fridaagronberg fridaagronberg removed their assignment Mar 11, 2023
@Delengowski
Copy link
Contributor

In situations like this, if both series had the same attrs, but different values how would we decide whose attr to take? Is it almost left most for binary ops?

@fbourgey
Copy link
Contributor

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug metadata _metadata, .attrs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants