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

ENH: read_parquet as a class method #58303

Open
1 of 3 tasks
davetapley opened this issue Apr 18, 2024 · 1 comment
Open
1 of 3 tasks

ENH: read_parquet as a class method #58303

davetapley opened this issue Apr 18, 2024 · 1 comment
Labels
Enhancement Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@davetapley
Copy link
Contributor

davetapley commented Apr 18, 2024

Feature Type

  • 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:

@davetapley davetapley added Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 18, 2024
@jbrockmendel
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

2 participants