Skip to content

Fix/options quote daterange parms#19

Merged
MarketDataDev02 merged 2 commits into
mainfrom
fix/options-quote-daterange-parms
May 11, 2026
Merged

Fix/options quote daterange parms#19
MarketDataDev02 merged 2 commits into
mainfrom
fix/options-quote-daterange-parms

Conversation

@MarketDataDev02
Copy link
Copy Markdown
Collaborator

Customer report (2026-04-30): the REST endpoint /v1/options/quotes/{symbol}/ accepts date, from, to query params, but OptionsQuotesInput only exposed symbols. Date-range historical quotes were unreachable except via **kwargs passthrough.

  • OptionsQuotesInput: add date, from_date (alias "from"), to_date (alias "to"); model_validator rejects from_date > to_date.

  • OptionsChainInput: add missing alias="from"/alias="to" on from_date/to_date — every other date-range input in sdk-py already had them; chain was the outlier. Latent (the API may have accepted both spellings) but worth fixing for consistency.

MarketDataDev02 and others added 2 commits April 30, 2026 14:33
Customer report: REST /v1/options/quotes/{symbol}/ accepts date, from, and
to but the SDK's options.quotes() only exposed symbols, so historical date
ranges were unreachable except via kwargs passthrough.

Adds three optional fields to OptionsQuotesInput:
  - date          -> wire param `date`
  - from_date     -> wire param `from`  (alias, since `from` is reserved in Python)
  - to_date       -> wire param `to`    (alias)

The Pydantic alias pattern matches StocksCandlesInput / FundsCandlesInput /
StocksEarningsInput. Adds a model_validator that rejects from_date > to_date,
matching the same pattern.

Tests:
  - from_date/to_date land on the wire as `from`/`to` (not snake_case)
  - date lands on the wire as `date`
  - from_date > to_date raises MinMaxDateValidationError

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
OptionsChainInput.from_date and to_date had no Pydantic alias, so they
serialized as `from_date=...&to_date=...` instead of the wire's
`from=...&to=...`. Every other date-range input in the SDK
(StocksCandlesInput, StocksEarningsInput, StocksNewsInput,
FundsCandlesInput, MarketsStatusInput) already uses alias="from" /
alias="to" - chain was the outlier.

Adds the aliases and a regression test asserting the rendered URL.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (aa19383) to head (68f8c6a).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #19   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           51        51           
  Lines         2205      2212    +7     
=========================================
+ Hits          2205      2212    +7     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MarketDataDev02 MarketDataDev02 merged commit 421d17d into main May 11, 2026
7 checks passed
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