This is an automated email from the ASF dual-hosted git repository. maximebeauchemin pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push: new 2861110 Refactor NULL handling into method, disable for DECK.gl vizes (#5106) 2861110 is described below commit 28611108d7c60d355dada9eb93d5beaa230d6b5f Author: Maxime Beauchemin <maximebeauche...@gmail.com> AuthorDate: Thu May 31 16:01:49 2018 -0700 Refactor NULL handling into method, disable for DECK.gl vizes (#5106) --- superset/viz.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/superset/viz.py b/superset/viz.py index a32456d..dcd924b 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -145,6 +145,10 @@ class BaseViz(object): """ pass + def handle_nulls(self, df): + fillna = self.get_fillna_for_columns(df.columns) + df = df.fillna(fillna) + def get_fillna_for_col(self, col): """Returns the value for use as filler for a specific Column.type""" if col: @@ -208,8 +212,7 @@ class BaseViz(object): self.df_metrics_to_num(df, query_obj.get('metrics') or []) df.replace([np.inf, -np.inf], np.nan) - fillna = self.get_fillna_for_columns(df.columns) - df = df.fillna(fillna) + self.handle_nulls(df) return df @staticmethod @@ -2041,6 +2044,9 @@ class BaseDeckGLViz(BaseViz): credits = '<a href="https://uber.github.io/deck.gl/">deck.gl</a>' spatial_control_keys = [] + def handle_nulls(self, df): + pass + def get_metrics(self): self.metric = self.form_data.get('size') return [self.metric] if self.metric else [] -- To stop receiving notification emails like this one, please contact maximebeauche...@apache.org.