mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-18 08:32:35 -05:00
fix
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.dialects.postgresql import insert
|
||||
from sqlalchemy.sql.expression import case
|
||||
|
||||
@@ -34,8 +33,8 @@ def insert_update_processing_time(processing_time):
|
||||
|
||||
|
||||
def get_processing_time_percentage_for_date_range(start_date, end_date):
|
||||
stmt = (
|
||||
select(
|
||||
query = (
|
||||
db.session.query(
|
||||
FactProcessingTime.local_date.cast(db.Text).label("date"),
|
||||
FactProcessingTime.messages_total,
|
||||
FactProcessingTime.messages_within_10_secs,
|
||||
@@ -53,11 +52,11 @@ def get_processing_time_percentage_for_date_range(start_date, end_date):
|
||||
(FactProcessingTime.messages_total == 0, 100.0),
|
||||
).label("percentage"),
|
||||
)
|
||||
.where(
|
||||
.filter(
|
||||
FactProcessingTime.local_date >= start_date,
|
||||
FactProcessingTime.local_date <= end_date,
|
||||
)
|
||||
.order_by(FactProcessingTime.local_date)
|
||||
)
|
||||
|
||||
return db.session.execute(stmt).scalars().all()
|
||||
return query.all()
|
||||
|
||||
Reference in New Issue
Block a user