diff --git a/caravel/models.py b/caravel/models.py index 71824b7fda72..2adb153035e8 100644 --- a/caravel/models.py +++ b/caravel/models.py @@ -1410,9 +1410,14 @@ def get_filters(raw_filters): if len(splitted) > 1: for s in eq.split(','): s = s.strip() + if s == 'NULL': + s = None fields.append(Dimension(col) == s) cond = Filter(type="or", fields=fields) else: + #allows setting filter to query that value of dimension is NULL + if eq == 'NULL': + eq = None cond = Dimension(col) == eq if op == 'not in': cond = ~cond diff --git a/caravel/viz.py b/caravel/viz.py index 57ef270a11dd..eb0cc1179866 100755 --- a/caravel/viz.py +++ b/caravel/viz.py @@ -177,7 +177,7 @@ def get_df(self, query_obj=None): if self.datasource.offset: df.timestamp += timedelta(hours=self.datasource.offset) df.replace([np.inf, -np.inf], np.nan) - df = df.fillna(0) + df = df.fillna('NULL') return df @property