Make orderby native sqla construct (#8180)

This commit is contained in:
Ville Brofeldt 2019-09-06 13:05:17 +03:00 committed by GitHub
parent 4e1e54b538
commit 15e623898d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -794,6 +794,8 @@ class SqlaTable(Model, BaseDatasource):
direction = asc if ascending else desc
if utils.is_adhoc_metric(col):
col = self.adhoc_metric_to_sqla(col, cols)
elif col in cols:
col = cols[col].get_sqla_col()
qry = qry.order_by(direction(col))
if row_limit: