This is an automated email from the ASF dual-hosted git repository.
graceguo 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 4b6681b Revert "FilterBox,BigNumber,WorldMap: Handle empty results
(#9671)" (#9755)
4b6681b is described below
commit 4b6681bc197d5eac604103eaac29470b07ceed7b
Author: Erik Ritter <[email protected]>
AuthorDate: Wed May 6 11:28:03 2020 -0700
Revert "FilterBox,BigNumber,WorldMap: Handle empty results (#9671)" (#9755)
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