Skip to content

Commit 55d44f0

Browse files
authored
Fix bug where all in-progress transforms were marked red even if only one failed (#459)
Take ahead of 3.0.1 since it's ready
1 parent 408974a commit 55d44f0

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

servicex/expandable_progress.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@
3333
TimeRemainingColumn, TaskID
3434

3535

36+
DEFAULT_STYLE = [TextColumn("[progress.description]{task.description}"),
37+
BarColumn(complete_style="rgb(114,156,31)",
38+
finished_style="rgb(0,255,0)"),
39+
MofNCompleteColumn(),
40+
TimeRemainingColumn(compact=True, elapsed_when_finished=True)
41+
]
42+
43+
BROKEN_STYLE = [TextColumn("[progress.description]{task.description}"),
44+
BarColumn(complete_style="rgb(255,0,0)"),
45+
MofNCompleteColumn(),
46+
TimeRemainingColumn(compact=True, elapsed_when_finished=True)
47+
]
48+
49+
3650
class ProgressCounts:
3751
def __init__(self,
3852
description: str,
@@ -74,13 +88,7 @@ def __init__(self,
7488
self.progress_counts = {}
7589
if display_progress:
7690
if self.overall_progress or not provided_progress:
77-
self.progress = TranformStatusProgress(
78-
TextColumn("[progress.description]{task.description}"),
79-
BarColumn(complete_style="rgb(114,156,31)",
80-
finished_style="rgb(0,255,0)"),
81-
MofNCompleteColumn(),
82-
TimeRemainingColumn(compact=True, elapsed_when_finished=True)
83-
)
91+
self.progress = TranformStatusProgress(*DEFAULT_STYLE)
8492

8593
if provided_progress:
8694
self.progress = provided_progress if isinstance(provided_progress, Progress) \
@@ -190,10 +198,7 @@ class TranformStatusProgress(Progress):
190198
def get_renderables(self):
191199
for task in self.tasks:
192200
if task.fields.get("bar") == "failure":
193-
self.columns = [
194-
TextColumn("[progress.description]{task.description}"),
195-
BarColumn(complete_style="rgb(255,0,0)"),
196-
MofNCompleteColumn(),
197-
TimeRemainingColumn(compact=True, elapsed_when_finished=True)
198-
]
201+
self.columns = BROKEN_STYLE
202+
else:
203+
self.columns = DEFAULT_STYLE
199204
yield self.make_tasks_table([task])

0 commit comments

Comments
 (0)