Skip to content

Commit

Permalink
filter out all nan series (#7313)
Browse files Browse the repository at this point in the history
  • Loading branch information
datability-io authored and betodealmeida committed Apr 19, 2019
1 parent 97718da commit 7192d36
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,16 +1112,22 @@ def to_series(self, df, classed='', title_suffix=''):
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,
Expand Down

0 comments on commit 7192d36

Please sign in to comment.