betodealmeida closed pull request #6073: Fix top groups with user defined
metrics
URL: https://github.com/apache/incubator-superset/pull/6073
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/UPDATING.md b/UPDATING.md
index 326a57d4f5..b17d32f692 100644
--- a/UPDATING.md
+++ b/UPDATING.md
@@ -19,7 +19,7 @@ assists people when migrating to a new version.
* Superset 0.28 upgrades `flask-login` to `>=0.3`, which includes a
backwards-incompatible change: `g.user.is_authenticated`,
`g.user.is_anonymous`, and `g.user.is_active` are now properties
- instead of properties.
+ instead of methods.
## Superset 0.27.0
* Superset 0.27 start to use nested layout for dashboard builder, which is not
diff --git a/superset/connectors/sqla/models.py
b/superset/connectors/sqla/models.py
index 75251f6ac0..89b07f681d 100644
--- a/superset/connectors/sqla/models.py
+++ b/superset/connectors/sqla/models.py
@@ -757,7 +757,11 @@ def get_sqla_query( # sqla
'order_desc': True,
}
result = self.query(subquery_obj)
- dimensions = [c for c in result.df.columns if c not in metrics]
+ cols = {col.column_name: col for col in self.columns}
+ dimensions = [
+ c for c in result.df.columns
+ if c not in metrics and c in cols
+ ]
top_groups = self._get_top_groups(result.df, dimensions)
qry = qry.where(top_groups)
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]