chore: Add debug prints for SQL query execution in stock data retrieval

This commit is contained in:
Bobby Abellana 2025-02-07 08:53:09 -08:00
parent d0583ddcc3
commit 8573399f9d
No known key found for this signature in database
GPG Key ID: 647714CC45F3647B

View File

@ -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