bugfixing

This commit is contained in:
MuslemRahimi 2025-02-01 13:35:35 +01:00
parent e00bf95839
commit 955e240a9e

View File

@ -215,7 +215,7 @@ async def get_data():
etf_cursor = etf_con.cursor() etf_cursor = etf_con.cursor()
etf_cursor.execute("PRAGMA journal_mode = wal") etf_cursor.execute("PRAGMA journal_mode = wal")
df = pd.read_sql_query(query, etf_con, params=("2025-01-20", '2025-01-27')) df = pd.read_sql_query(query, etf_con, params=("2025-01-20", datetime.today().strftime("%Y-%m-%d")))
if not df.empty: if not df.empty:
df['changesPercentage'] = (df['close'].pct_change() * 100).round(2) df['changesPercentage'] = (df['close'].pct_change() * 100).round(2)
sp500_list = df.dropna().to_dict(orient="records") # Drop NaN values and convert to list sp500_list = df.dropna().to_dict(orient="records") # Drop NaN values and convert to list