From 0557440f2e3625d063dad8f173ad6cf8873ae12b Mon Sep 17 00:00:00 2001 From: Matthew Rocklin Date: Mon, 12 Mar 2018 09:16:53 -0400 Subject: [PATCH] Avoid testing truthiness of bokeh source, use len instead This can be a numpy array in some cases. We use len to avoid errors like the following: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() --- distributed/bokeh/scheduler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distributed/bokeh/scheduler.py b/distributed/bokeh/scheduler.py index 02586c1e7f2..a2941bd6951 100644 --- a/distributed/bokeh/scheduler.py +++ b/distributed/bokeh/scheduler.py @@ -559,7 +559,7 @@ def update(self): if self.index == self.plugin.index: return with log_errors(): - if self.index and self.source.data['start']: + if self.index and len(self.source.data['start']): start = min(self.source.data['start']) duration = max(self.source.data['duration']) boundary = (self.offset + start - duration) / 1000