Skip to content

Commit be08e1c

Browse files
Pigbibiclaude
andauthored
fix: is_market_open_now always returns tuple for consistent caller handling
Co-authored-by: Claude <noreply@anthropic.com>
1 parent a64a332 commit be08e1c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

entrypoints/cloud_run.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ def is_market_open_now(*, calendar_name="NYSE", timezone_name="America/New_York"
1414
market_tz = pytz.timezone(timezone_name)
1515
now_market = datetime.now(market_tz)
1616
schedule = calendar.schedule(start_date=now_market.date(), end_date=now_market.date())
17-
return False if schedule.empty else calendar.open_at_time(schedule, now_market)
17+
if schedule.empty:
18+
return False, None
19+
return calendar.open_at_time(schedule, now_market), None
1820
except Exception as exc:
1921
return False, exc

0 commit comments

Comments
 (0)