Feature Type

  • [X] Adding new functionality to pandas

  • [ ] Changing existing functionality in pandas

  • [ ] Removing existing functionality in pandas

Problem Description

Issue #54321 added support for attrs in parquet files. This is a request to do the same thing for feather files.

Feature Description

Add support for DataFrame.attrs in to_feather() and read_feather().

Alternative Solutions

I'm unsure if this lack of implementation is due to just nobody having done it, or if the arrow format doesn't support it. If it's not supported, I might suggest adding a note to the to_feather documentation, similar to like is already done for the lack of support for custom indexes.

Additional Context

import pandas as pd

df = pd.DataFrame([{"foo":1}])
df.attrs['foo'] = 'bar'

df.to_feather("/tmp/foo.feather")
print(pd.read_feather("/tmp/foo.feather").attrs)

Should output:

{'foo': 'bar'}