From b5026ac6bafd502b597f59b30411cca8eec74667 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Tue, 10 Dec 2024 10:44:24 +0100 Subject: [PATCH] bugfixing --- app/cron_dashboard.py | 2 +- app/cron_earnings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/cron_dashboard.py b/app/cron_dashboard.py index 224df0d..8fc9ba8 100644 --- a/app/cron_dashboard.py +++ b/app/cron_dashboard.py @@ -147,7 +147,7 @@ async def get_upcoming_earnings(session, end_date, filter_today=True): revenue_est = float(item['revenue_est']) if item['revenue_est'] != '' else 0 revenue_prior = float(item['revenue_prior']) if item['revenue_prior'] != '' else 0 - if symbol in stock_symbols and revenue_est and revenue_prior and eps_prior and eps_est: + if symbol in stock_symbols and revenue_est is not None and revenue_prior is not None and eps_prior is not None and eps_est is not None: df = pd.read_sql_query(query_template, con, params=(symbol,)) market_cap = float(df['marketCap'].iloc[0]) if df['marketCap'].iloc[0] != '' else 0 res_list.append({ diff --git a/app/cron_earnings.py b/app/cron_earnings.py index 700c212..4c9b543 100644 --- a/app/cron_earnings.py +++ b/app/cron_earnings.py @@ -94,7 +94,7 @@ async def get_data(session, ticker): revenue_prior = float(nearest_recent['revenue_prior']) if nearest_recent['revenue_prior'] != '' else 0 revenue_surprise = float(nearest_recent['revenue_surprise']) if nearest_recent['revenue_surprise'] != '' else 0 revenue = float(nearest_recent['revenue']) if nearest_recent['revenue'] != '' else 0 - if revenue != 0 and revenue_prior != 0 and eps_prior != 0 and eps != 0 and revenue_surprise != 0 and eps_surprise != 0: + if revenue is not None and revenue_prior is not None and eps_prior is not None and eps is not None and revenue_surprise is not None and eps_surprise is not None: res_list = { 'epsPrior':eps_prior, 'epsSurprise': eps_surprise,