-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[Data] Progress Bar: Sort sample in "rows" and remove the duplicate Sort sample. #47106
Merged
Merged
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9b272f5
fix
Bye-legumes e918799
fix
Bye-legumes 119abac
fix
Bye-legumes bda3b8a
fix
Bye-legumes 6bdc2b6
fix
Bye-legumes f6310c5
fix sort
Bye-legumes 6eac034
fix
Bye-legumes bc0299c
fix
Bye-legumes 8f8e584
fix
Bye-legumes dbcc6b4
fix
Bye-legumes b37e41f
fix
Bye-legumes 72c00ef
fix
Bye-legumes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,9 +136,12 @@ def block_until_complete(self, remaining: List[ObjectRef]) -> None: | |
) | ||
total_rows_processed = 0 | ||
for _, result in zip(done, ray.get(done)): | ||
num_rows = ( | ||
result.num_rows if hasattr(result, "num_rows") else 1 | ||
) # Default to 1 if no row count is available | ||
if hasattr(result, "num_rows"): | ||
num_rows = result.num_rows | ||
elif hasattr(result, "__len__"): | ||
num_rows = len(result) | ||
else: | ||
num_rows = 1 | ||
total_rows_processed += num_rows | ||
self.update(total_rows_processed) | ||
|
||
|
@@ -167,9 +170,13 @@ def fetch_until_complete(self, refs: List[ObjectRef]) -> List[Any]: | |
total_rows_processed = 0 | ||
for ref, result in zip(done, ray.get(done)): | ||
ref_to_result[ref] = result | ||
num_rows = ( | ||
result.num_rows if hasattr(result, "num_rows") else 1 | ||
) # Default to 1 if no row count is available | ||
if hasattr(result, "num_rows"): | ||
num_rows = result.num_rows | ||
elif hasattr(result, "__len__"): | ||
# For output is DataFrame,i.e. sort_sample | ||
num_rows = len(result) | ||
else: | ||
num_rows = 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you consolidate this logic and the one in |
||
total_rows_processed += num_rows | ||
# TODO(zhilong): Change the total to total_row when init progress bar | ||
self.update(total_rows_processed) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this. I think we actually want to keep this bar here, so that it is initialized as a sub-progress bar for the
![357460721-30aa9fc3-8e96-473e-a794-da4fc023093a](https://private-user-images.githubusercontent.com/5122851/357603926-828646a5-751c-4bc8-982f-e0625b650815.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTk5NTMsIm5iZiI6MTczOTYxOTY1MywicGF0aCI6Ii81MTIyODUxLzM1NzYwMzkyNi04Mjg2NDZhNS03NTFjLTRiYzgtOTgyZi1lMDYyNWI2NTA4MTUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMTE0MDUzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGNjZWNlNmY1YzFlNzMxNGNkYzEyMGI3NWI5NmMyOTNjZTBjZDFkYjgxMTEwN2E4NDc4OGMzZjcyMmYxYzI1NCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.3tHsCCAQkwqLfSMrTiUAZCniEG0YajgVUnbzOcl7x-g)
AbstractAllToAll
op, and we should remove the one that is created inSortTaskSpec.sample_boundaries()
. We want the "Sort Sample" to be a sub-bar of the overallSort
bar, like this:In terms of the concrete change, we can update
sample_boundaries()
to reference the sub-progress bar that is part of the operator. This will also require us to either:(1) change
sample_boundaries
from a static method to class method, and use the object's sub-progress bar(2) add a
sub_progress_bar
parameter tosample_boundaries()
, and at the callers of this method, pass theSortTaskSpec
instance's progress bar (e.g. here)