You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/05/31 23:01:51 UTC
[GitHub] mistercrunch closed pull request #5106: Refactor NULL handling into
method, disable for DECK.gl vizes
mistercrunch closed pull request #5106: Refactor NULL handling into method, disable for DECK.gl vizes
URL: https://github.com/apache/incubator-superset/pull/5106
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/superset/viz.py b/superset/viz.py
index 1086af89fd..35553ee590 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -145,6 +145,10 @@ def run_extra_queries(self):
"""
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 @@ def get_df(self, query_obj=None):
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 []
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org