Fix sqlalchemy grouping on v1 storage
This fixes "CompileError: Can't resolve label reference for ORDER BY / GROUP BY." error messages raised by sqlalchemy when the groupby expression includes a comma. Change-Id: Ia253175b45b8222aaee415ea535fa4102312be5a
This commit is contained in:
parent
559a16d710
commit
5fef2d68f3
@ -119,7 +119,7 @@ class SQLAlchemyStorage(storage.BaseStorage):
|
||||
self.frame_model.end <= end,
|
||||
self.frame_model.res_type != '_NO_DATA_')
|
||||
if groupby:
|
||||
q = q.group_by(groupby)
|
||||
q = q.group_by(sqlalchemy.sql.text(groupby))
|
||||
|
||||
# Order by sum(rate)
|
||||
q = q.order_by(sqlalchemy.func.sum(self.frame_model.rate))
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
``CompileError: Can't resolve label reference for ORDER BY / GROUP BY.``
|
||||
errors that were sometimes raised by SQLAlchemy when using the v1 storage
|
||||
backend and grouping on ``tenant_id`` and ``res_type`` have been fixed.
|
Loading…
x
Reference in New Issue
Block a user