Skip to content

Validate futures series contract dates#1

Open
JustinMShea wants to merge 3 commits into
masterfrom
fix/future-series-validation
Open

Validate futures series contract dates#1
JustinMShea wants to merge 3 commits into
masterfrom
fix/future-series-validation

Conversation

@JustinMShea

Copy link
Copy Markdown
Owner

Adds validation for futures contract suffixes and dates. Invalid dates now produce clear errors, inconsistent contract months produce warnings, and the existing continuous-contract and spread formats remain supported. Adds focused tinytest coverage without changing the public API.

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.

Pull request overview

This PR adds internal validation for futures series identifiers and contract dates, surfacing invalid inputs as clear errors and warning when an outright suffix month/year conflicts with the supplied expiration, while keeping existing storage formats (including YYYY-MM) and series/spread/continuous formats supported.

Changes:

  • Introduces internal parsing/validation helpers for suffixes and date inputs, including mismatch warnings and invalid-date errors.
  • Wires the new validation into future_series() construction flow.
  • Adds focused tinytest coverage for successful creation, warnings, and error cases.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
R/instrument.R Calls the new internal validator during future_series() construction.
R/future_series_validation.R Adds internal helpers to parse/validate suffixes and (month/day) date inputs, emitting warnings/errors.
inst/tinytest/test_future_series.R Adds regression tests covering valid series creation, mismatch warnings, and invalid inputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread R/future_series_validation.R
Comment thread inst/tinytest/test_future_series.R
JustinMShea and others added 2 commits July 13, 2026 18:30
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

2 participants