Skip to content

BUG: Don't copy DataFrame columns as metadata #37205

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 1 commit into from
Oct 20, 2020

Conversation

TomAugspurger
Copy link
Contributor

See https://github.com/pandas-dev/pandas/pull/37186/files#r506978889.
Basically, we don't want to accidentally do series.name = dataframe.name and try to set a column.

cc @jorisvandenbossche. This could conceivably affect geopandas, since geodataframe has different metadata than geoseries: https://github.com/geopandas/geopandas/blob/924cdf65c7c15b01749d1cdd036c5c291e87b0f4/geopandas/geodataframe.py#L83

But I don't think it'll actually break anything for you.

See https://github.com/pandas-dev/pandas/pull/37186/files#r506978889.
Basically, we don't want to accidentally do `series.name =
dataframe.name` and try to set a column.
@TomAugspurger
Copy link
Contributor Author

Also cc @arw2019

@TomAugspurger TomAugspurger added the metadata _metadata, .attrs label Oct 18, 2020
@TomAugspurger TomAugspurger added this to the 1.2 milestone Oct 18, 2020
@jreback jreback merged commit f2dcd24 into pandas-dev:master Oct 20, 2020
@jreback
Copy link
Contributor

jreback commented Oct 20, 2020

thanks @TomAugspurger

JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Oct 26, 2020
@jorisvandenbossche
Copy link
Member

This could conceivably affect geopandas, since geodataframe has different metadata than geoseries: https://github.com/geopandas/geopandas/blob/924cdf65c7c15b01749d1cdd036c5c291e87b0f4/geopandas/geodataframe.py#L83

But I don't think it'll actually break anything for you.

Indeed, I also can't think of a situation where it would break anything (and our tests using pandas master didn't show up any failure). Whenever a metadata attribute existed on self but not on other, it would not be set to any value anyway

@TomAugspurger TomAugspurger deleted the metadata-finalize-name branch October 28, 2020 11:33
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metadata _metadata, .attrs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants