Skip to content

Conversation

IrishNova
Copy link

Apply normalize() to session labels in both TradingDayOfWeekRule and TradingDayOfMonthRule to resolve 'YYYY-mm-dd HH:mm:ss+00:00 is not a trading minute' error when using week_start() and week_end() date_rules.

The fix adds .normalize() before .value to strip timezone information from session labels, ensuring they match the expected midnight UTC format.

Changes:

  • Line 484: Add .normalize() to TradingDayOfWeekRule.should_trigger()
  • Line 530: Add .normalize() to TradingDayOfMonthRule.should_trigger()

Fixes #2860

Apply normalize() to session labels in both TradingDayOfWeekRule and
TradingDayOfMonthRule to resolve 'YYYY-mm-dd HH:mm:ss+00:00 is not a
trading minute' error when using week_start() and week_end() date_rules.

The fix adds .normalize() before .value to strip timezone information
from session labels, ensuring they match the expected midnight UTC format.

Changes:
- Line 484: Add .normalize() to TradingDayOfWeekRule.should_trigger()
- Line 530: Add .normalize() to TradingDayOfMonthRule.should_trigger()

Fixes quantopian#2860
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Additional patch to workaround "YYYY-mm-dd HH:mm:ss+00:00 is not a trading minute
1 participant