Skip to content

Add dataframe.collect #219

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions spec/API_specification/dataframe_api/dataframe_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,3 +838,16 @@ def to_array_object(self, dtype: Any) -> Any:
understanding that consuming libraries would then use the
``array-api-compat`` package to convert it to a Standard-compliant array.
"""

def collect(self) -> Any:
Copy link
Contributor

Choose a reason for hiding this comment

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

Existing APIs of lazy dataframes look quite different and the equivalent of the collect() function accepts various implementation-specific kwargs 1, 2.

Can it be assumed that each library has "reasonable defaults" that will work for most use-cases, and those can be used in their implementations of collect()? (I think it can, but just making sure we consider this).

Choose a reason for hiding this comment

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

Also should this be part of DataFrame, or should a new LazyFrame interface be introduced?

"""
Materialize the DataFrame.

Non-lazy implementations may just return `self`.

Returns
-------
Any
The materialized object.
"""
...