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

Removes empty partitions after dropping rows and splitting datasets #2328

Merged
merged 34 commits into from
Aug 4, 2022

Conversation

geoffreyangus
Copy link
Contributor

@geoffreyangus geoffreyangus commented Jul 28, 2022

This PR addresses two separate issues: #2324 and #2308.

The issues are addressed by culling empty partitions from the Dask DataFrame at two points: (1) after dropping rows with NaNs (part of the DROP_ROWS missing value strategy) and (2) after splitting the dataset into train/val/test.

In order to maintain/increase performance, we add a persist call at the end of build_dataset, which makes it relatively inexpensive to compute the length of partitions repeatedly downstream.

@arnavgarg1 arnavgarg1 linked an issue Jul 28, 2022 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Jul 28, 2022

Unit Test Results

       6 files  ±0         6 suites  ±0   2h 30m 37s ⏱️ + 7m 52s
2 947 tests +1  2 898 ✔️ +1    49 💤 ±0  0 ±0 
8 841 runs  +3  8 658 ✔️ +3  183 💤 ±0  0 ±0 

Results for commit 5cd4d49. ± Comparison against base commit 44afa4f.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@arnavgarg1 arnavgarg1 left a comment

Choose a reason for hiding this comment

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

Thanks for making this change - looks good to me!

@geoffreyangus geoffreyangus marked this pull request as ready for review August 1, 2022 19:02
@@ -129,7 +149,24 @@ def to_ray_dataset(self, df):
return from_dask(df)

def from_ray_dataset(self, dataset) -> dd.DataFrame:
return dataset.to_dask()
"""Custom Ray to Dask conversion implementation to pass in meta during dd.DataFrame creation."""
Copy link
Contributor

Choose a reason for hiding this comment

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

@geoffreyangus should we revert back to dataset.to_dask() if the empty partitions issue doesn't stem from a need to pass in meta?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, reverted!

@arnavgarg1
Copy link
Contributor

LGTM!

@geoffreyangus geoffreyangus merged commit dc047cd into master Aug 4, 2022
@geoffreyangus geoffreyangus deleted the remove-empty-partitions branch August 4, 2022 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metadata mismatch while calculating overall stats
3 participants