fix: Replace undefined 'today' with 'end_date' in stock data queries

This commit is contained in:
Bobby Abellana (aider) 2025-02-06 22:23:28 -08:00
parent 507687dc90
commit 207991b9f0
No known key found for this signature in database
GPG Key ID: 647714CC45F3647B

View File

@ -48,7 +48,7 @@ def get_stock_data(ticker: str, start_date: datetime, end_date: datetime, interv
volume
FROM stock_db.{table}
WHERE ticker = '{ticker}'
AND {date_col} BETWEEN '{start_date}' AND '{today}'
AND {date_col} BETWEEN '{start_date}' AND '{end_date}'
ORDER BY date ASC
"""
else:
@ -73,7 +73,7 @@ def get_stock_data(ticker: str, start_date: datetime, end_date: datetime, interv
sum(volume) as volume
FROM stock_db.{table}
WHERE ticker = '{ticker}'
AND {date_col} BETWEEN toUnixTimestamp('{start_date}') AND toUnixTimestamp('{today}')
AND {date_col} BETWEEN toUnixTimestamp('{start_date}') AND toUnixTimestamp('{end_date}')
GROUP BY interval_start
ORDER BY interval_start ASC
"""