diff --git a/distributed/diagnostics/progressbar.py b/distributed/diagnostics/progressbar.py index 37b911fc0f..2a5bce8c67 100644 --- a/distributed/diagnostics/progressbar.py +++ b/distributed/diagnostics/progressbar.py @@ -337,8 +337,9 @@ def __init__( **kwargs, ): super().__init__(keys, scheduler, **kwargs) - from ipywidgets import VBox + from ipywidgets import HTML, VBox + self.elapsed_time = HTML("") self.widget = VBox([]) def make_widget(self, all): diff --git a/distributed/diagnostics/tests/test_progress_widgets.py b/distributed/diagnostics/tests/test_progress_widgets.py index 2d4ef1b3f9..f5cb6b7009 100644 --- a/distributed/diagnostics/tests/test_progress_widgets.py +++ b/distributed/diagnostics/tests/test_progress_widgets.py @@ -92,6 +92,12 @@ def test_values(client): assert p.status == "error" +def test_multi_progressbar_widget_empty_keys_does_not_error(): + p = MultiProgressWidget([], scheduler="tcp://127.0.0.1:1") + p._draw_stop(remaining={}, status="finished") + assert "Finished" in p.elapsed_time.value + + def test_progressbar_done(client): L = [client.submit(inc, i) for i in range(5)] wait(L)