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

API: Store name outside attrs #30798

Merged
merged 3 commits into from
Jan 8, 2020

Conversation

TomAugspurger
Copy link
Contributor

This aligns with xarray and h5py:
#29062 (comment)

@TomAugspurger TomAugspurger added this to the 1.0 milestone Jan 7, 2020
@@ -159,7 +159,8 @@ class Series(base.IndexOpsMixin, generic.NDFrame):

_typ = "series"

_metadata: List[str] = []
_name: Hashable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional hashable?

@jreback jreback added the API - Consistency Internal Consistency of API/Behavior label Jan 7, 2020
@jreback
Copy link
Contributor

jreback commented Jan 7, 2020

sure x- @jbrockmendel comment.

@jorisvandenbossche
Copy link
Member

@TomAugspurger maybe also add a note somewhere that attrs is experimental?


.. warning::

attrs is experimental and may change without warning.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can you also add this in the reference docs (where you added it in https://github.com/pandas-dev/pandas/pull/29062/files)

@TomAugspurger TomAugspurger merged commit 50842c0 into pandas-dev:master Jan 8, 2020
@TomAugspurger TomAugspurger deleted the attrs-name branch January 8, 2020 14:09
@achapkowski
Copy link

When will this feature be not experimental? Is allows for persistence of data when pickling on accessors. I would encourage to remove the experimental tag.

@TomAugspurger
Copy link
Contributor Author

You can remove the experimental label if you want. The basics aren't go to change. However, there are two future changes that will affect things in attrs

  1. __finalize__ isn't called everywhere: Series .attrs is not correctly maintained/propagated in to_frame #31452
  2. We might provide an API for merging .attrs of multiple dataframes in operations like concat. This might be doable in a backwards-compat way. I'm not sure yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Consistency Internal Consistency of API/Behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants