Fix/options quote daterange parms#19
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
MarketDataDev01
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Customer report (2026-04-30): the REST endpoint /v1/options/quotes/{symbol}/ accepts
date,from,toquery params, butOptionsQuotesInputonly exposedsymbols. 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.