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

Progress bar changes color on completion and failure #397

Open
wants to merge 63 commits into
base: 3.0_develop
Choose a base branch
from

Conversation

ketan96-m
Copy link
Collaborator

Issue

#382

Description

The current progress bar is green through out the process.
Introduced a muted green color for normal process and added a brighter green color when transform bar and download bar finishes all files.
If the transformation fails prematurely, then the bar changes the color to red.

Normal progress:
image

Completed progress:
image

Failed Progress:
image

Solution:

Created a custom TransformStatusProgress class which inherits the Progress from rich.progress.
get_renderables() function is overloaded to update the BarColumn() with the red color in case of failed files.

Added an if condition inside the query.py's transform_status_listener that checks that the transform is complete and if there are any failed files and then call the update method for the progress bar.

The update method takes a new keyword argument to indicate if transformation is complete or not.

Added subsequent test cases to test this new get_renderables() function and also edited other test cases to with the new TransformStatusProgress.

Copy link

codecov bot commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 90.74074% with 20 lines in your changes missing coverage. Please review.

Project coverage is 75.19%. Comparing base (31f7ef3) to head (4ddfb10).
Report is 77 commits behind head on 3.0_develop.

Files Patch % Lines
servicex/databinder/databinder_requests.py 21.73% 18 Missing ⚠️
servicex/databinder/databinder_outputs.py 66.66% 1 Missing ⚠️
servicex/uproot_raw/uproot_raw.py 95.65% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           3.0_develop     #397      +/-   ##
===============================================
+ Coverage        73.85%   75.19%   +1.33%     
===============================================
  Files               42       30      -12     
  Lines             2310     1431     -879     
===============================================
- Hits              1706     1076     -630     
+ Misses             604      355     -249     
Flag Coverage Δ
unittests 75.19% <90.74%> (+1.33%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

if task.fields.get("bar") == "failure":
self.columns = [
TextColumn("[progress.description]{task.description}"),
BarColumn(complete_style="rgb(255,0,0)"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this here and different from complete_style="rgb(114,156,31) above?

Copy link
Collaborator Author

@ketan96-m ketan96-m Jun 24, 2024

Choose a reason for hiding this comment

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

And this red color is for when the bar is progressing but some files have failed.
image

TextColumn("[progress.description]{task.description}"),
BarColumn(),
BarColumn(complete_style="rgb(114,156,31)",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the muted green color when the bar is progressing.
image

@ponyisi ponyisi marked this pull request as draft June 27, 2024 18:47
@ponyisi ponyisi marked this pull request as ready for review June 27, 2024 18:47
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.

None yet

4 participants