Feature Type

  • [X] Adding new functionality to pandas

  • [ ] Changing existing functionality in pandas

  • [ ] Removing existing functionality in pandas

Problem Description

I wish I could use read_parquet on a DataFrame subclass and it would Just Work.

Currently I have to:


class Foo(pd.DataFrame):
    # stuff from
    # https://pandas.pydata.org/pandas-docs/stable/development/extending.html#override-constructor-properties
    ....

df = read_parquet(file)
foo = Foo(df)
foo.attrs = df.attrs
# maybe I missed something else?

Feature Description

A Foo.read_parquet(file) which would return a Foo with attrs and everything else.

Alternative Solutions

As shown in description I can manually copy attrs, but it's not idea.

Additional Context

Related to: - https://github.com/pandas-dev/pandas/issues/37099 - https://github.com/pandas-dev/pandas/issues/52166

Comment From: jbrockmendel

For the most part we want either pd.function or DataFrame.method, not both.

Comment From: simonjayhawkins

in addition to https://github.com/pandas-dev/pandas/issues/58303#issuecomment-2067869184, for api consistency, it would need to be applicable for all pd.read_* functions and not just pd.read_parquet?

Comment From: davetapley

@simonjayhawkins to be sure, this is closed because it won't be implemented?