Skip to content

fix: preserve calendar declarations and instant boundaries in session APIs #93

Closed

Description

@stefan-jansen

Reproduced session-boundary problems

On55b86e250fd6279222876c5a1e4c20ae1469d7fa, DataManager.assign_sessions on a real SyntheticProvider frame with calendar=None raises Must provide either exchange or calendar rather than disabling schedules. Omission also fails instead of NYSE. SessionAssigner('24/7').assign_sessions on continuous-provider hourly bars at July7 00:00 and01:00 UTC, bar_frequency='intraday', assigns null at midnight instead of the new day's session because the forward-close join selects the previous closed interval. DataManager without storage also ignores complete_sessions(fill_gaps=False), unlike its storage-backed path.

Required contract

Canonical calendar constructor/API selection uses shared FeedSpec resolution: explicit, declared input/feed metadata, then NYSE. Explicit None returns observations unchanged without a manufactured session column or imputation. Keep positional names and calendar_name/exchange selector arguments as compatibility aliases; contradictory explicit selectors fail clearly. Metadata exchange identity alone is not a selector.

Version-2 Data Metadata must preserve omitted versus explicit-null calendar through JSON/copy and shared FeedSpec projection; retain version-1 legacy null inheritance. Delegate normalization/serialization to shared Specs, not a separate resolver. Propagate declared timestamp semantics/timezone through DataManager and low-level session adapters.

Session labels preserve civil dates. Explicit event_time/bar_close declarations override daily-frequency and midnight heuristics. Event intervals are [open,close), including the exact start of a continuous session; close-labeled bars use (open,close]. Apply matching break boundaries. Retain existing null/raise/drop outside-session policy. Naive instants retain the existing UTC interpretation unless the feed explicitly declares a timezone; ambiguous/nonexistent local times fail. Daily session labels are not event instants.

Session completion remains an explicit minute-grid operation. fill_gaps=False performs assignment without expansion, independently of storage configuration. Calendar=None performs no expansion. Existing minute completion supports open-labeled event bars only; unsupported explicit close-label/session-label declarations fail clearly rather than being silently used as minute instants. Intraday gap-grid classification and futures roll scheduling remain separate accepted repairs.

Use real provider/public-facade and persisted Metadata regressions, exact-source failing-base/passing-fix evidence and hosted full gates. Keep the workstation reservation: light focused single-thread local checks only. No release/deployment, new agents or changes to published0.2.1. AI-assisted implementation under maintainer direction.

Activity

  1. added a commit that references this issue on Oct 20, 2026
    da7d259
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions