Skip to content

Commit

Permalink
Fix top groups with user defined metrics (apache#6073)
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida authored Oct 11, 2018
1 parent 9b4cf85 commit 247a85b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 247a85b

Please sign in to comment.