This is an automated email from the ASF dual-hosted git repository.

beto pushed a commit to branch lyftga
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/lyftga by this push:
     new 7192d36  filter out all nan series (#7313)
7192d36 is described below

commit 7192d365130fc4b712af9de136140513c9403fc4
Author: Thomas Wang <[email protected]>
AuthorDate: Fri Apr 19 08:59:19 2019 -0700

    filter out all nan series (#7313)
---
 superset/viz.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/superset/viz.py b/superset/viz.py
index 786fad1..026581e 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -1112,16 +1112,22 @@ class NVD3TimeSeriesViz(NVD3Viz):
                     series_title = series_title + (title_suffix,)
 
             values = []
+            non_nan_cnt = 0
             for ds in df.index:
                 if ds in ys:
                     d = {
                         'x': ds,
                         'y': ys[ds],
                     }
+                    if not np.isnan(ys[ds]):
+                        non_nan_cnt += 1
                 else:
                     d = {}
                 values.append(d)
 
+            if non_nan_cnt == 0:
+                continue
+
             d = {
                 'key': series_title,
                 'values': values,

Reply via email to