From 8573399f9d73462e0e8e5cb97f6e7ec15f2ca069 Mon Sep 17 00:00:00 2001 From: Bobby Abellana Date: Fri, 7 Feb 2025 08:53:09 -0800 Subject: [PATCH] chore: Add debug prints for SQL query execution in stock data retrieval --- src/screener/t_sunnyband.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/screener/t_sunnyband.py b/src/screener/t_sunnyband.py index 41b0be2..3792cfc 100644 --- a/src/screener/t_sunnyband.py +++ b/src/screener/t_sunnyband.py @@ -84,7 +84,9 @@ def get_stock_data(ticker: str, start_date: datetime, end_date: datetime, interv ORDER BY interval_start ASC """ - try: + print("\nExecuting Query:") + print(query) # Debugging: Print the query to verify its correctness + result = client.query(query) if not result.result_rows: print(f"No data found for {ticker}") @@ -313,6 +315,8 @@ def run_sunny_scanner(min_price: float, max_price: float, min_volume: int, portf result = client.query(query) qualified_stocks = [(row[0], row[1], row[2], row[3]) for row in result.result_rows] + qualified_stocks = [(row[0], row[1], row[2], row[3]) for row in result.result_rows] + if not qualified_stocks: print("No stocks found matching criteria.") return