This is an automated email from the ASF dual-hosted git repository. erikrit pushed a commit to branch revert-9671-viz_empty_results in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
commit cee0b31113e51f472df943b066bab80abdb544a0 Author: Erik Ritter <[email protected]> AuthorDate: Wed May 6 11:16:56 2020 -0700 Revert "FilterBox,BigNumber,WorldMap: Handle empty results (#9671)" This reverts commit 865a9096906c5c564d86c422fc3bd35e9a3444bd. --- superset/viz.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/superset/viz.py b/superset/viz.py index 1a176f4..c167329 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -1143,9 +1143,6 @@ class BigNumberViz(BaseViz): return d def get_data(self, df: pd.DataFrame) -> VizData: - if df.empty: - return None - df = df.pivot_table( index=DTTM_ALIAS, columns=[], @@ -1881,9 +1878,6 @@ class WorldMapViz(BaseViz): return qry def get_data(self, df: pd.DataFrame) -> VizData: - if df.empty: - return None - from superset.examples import countries fd = self.form_data @@ -1958,7 +1952,7 @@ class FilterBoxViz(BaseViz): col = flt.get("column") metric = flt.get("metric") df = self.dataframes.get(col) - if df is not None and not df.empty: + if df is not None: if metric: df = df.sort_values( utils.get_metric_name(metric), ascending=flt.get("asc") @@ -1973,8 +1967,6 @@ class FilterBoxViz(BaseViz): {"id": row[0], "text": row[0]} for row in df.itertuples(index=False) ] - if not d: - return None return d
