Skip to content

fix(calendars): use the exchange date for equity session filtering - #89

Merged
stefan-jansen merged 1 commit into
mainfrom
codex/equity-session-exchange-date
Oct 15, 2026
Merged

stefan-jansen merged 1 commit into
mainfrom
codex/equity-session-exchange-date

Conversation

@stefan-jansen

Copy link
Copy Markdown
Contributor

Closes #88.

Select the provider schedule using the actual exchange's local date after interpreting the timestamp. The same NYSE trading instant now has the same session membership in UTC, New York, Tokyo and Sydney, including when the configured timezone is overridden. Preserve naive timestamps' configured-timezone interpretation, inclusive open/close boundaries, and the existing optional-provider fallback. Other calendar methods and public signatures are unchanged.

Reviewed head: 6299d8a. Base: 0a3acdc.

Regression command on both revisions:

uv run pytest tests/core/test_calendars.py -k 'keeps_exchange_rows or naive_timestamps_use_configured or missing_calendar_provider' -q -o addopts=''

The base produces five failures and nine passing controls. The fix passes all 14 cases. The tests use actual Polars timezone conversion and the real calendar provider, with winter/summer trading, before/after hours, open and inclusive close boundaries, July 3 early close, July 4 holiday, configured Tokyo timezone, naive inputs and four genuine missing-provider import controls. All 94 calendar and labeling tests pass, preserving the earlier CME repair.

Ruff check/format, ty, all-file hooks, lock validation, wheel/sdist build, import, twine metadata checks and strict MkDocs pass. Full suites pass with 4,266 tests, 57 intentional deselections and 17 known warnings on each of Python 3.12, 3.13 and 3.14. The isolated built wheel with pandas-market-calendars 5.5.0 passes both the original public reproduction and all ten expanded timezone/boundary workflows. Fresh current-head hosted qualification is required before merge; results on earlier revisions are not reused as current readiness.

Valid session rows previously dropped across timezone midnight are now retained. This behavioral correction belongs in the eventual qualified patch release; this PR does not release or deploy anything.

AI assistance: Codex reproduced the public filtering defect on the published package and current source, implemented this focused repair and permanent regressions, ran the recorded checks, and prepared this description.

Copilot AI balanced review requested due to automatic review settings October 15, 2026 02:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@stefan-jansen
stefan-jansen merged commit 2259402 into main Oct 15, 2026
31 checks passed
@stefan-jansen
stefan-jansen deleted the codex/equity-session-exchange-date branch October 15, 2026 03:27
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.

fix: normalize exchange date before filtering equity sessions

2 participants