This commit is contained in:
wuaho 2021-09-30 18:06:46 +08:00
parent 7580c1e563
commit 57bb539d4d

View File

@ -40,7 +40,7 @@ class CombinationEvent:
result = round(result, 2)
elif self.format == 'integer':
result = result.astype(int)
return result.to_list(), result.sum(), round(result.mean(), 2)
return result.to_list(), round(result.sum(), 2), round(result.mean(), 2)
class CustomEvent:
@ -641,7 +641,8 @@ ORDER BY level
elif event.get('quota'):
event_attr_col = getattr(self.event_tbl.c, event['quota'])
qry = sa.select(event_date_col,e_account_id_col, settings.CK_FUNC[analysis](event_attr_col).label('values')) \
qry = sa.select(event_date_col, e_account_id_col,
settings.CK_FUNC[analysis](event_attr_col).label('values')) \
.where(and_(*where)) \
.group_by(event_date_col, *self.groupby, e_account_id_col)
sql = str(qry.compile(compile_kwargs={"literal_binds": True}))