Repository navigation
Conversation
Several hints describe values the API never sends or returns:
- CryptoQuote.bid_price, ask_price and ask_size were int; XQ sends
fractional numbers ("bp": 33052.79, "as": 0.601). They are float.
- IndexValue.timestamp was str; V sends integer Unix milliseconds.
- list_tickers(cusip=...) accepted only int. The API treats a CUSIP as a
string: it is alphanumeric, and leading zeros matter ("037833100").
The hint now accepts str as well as int, so existing callers keep
type-checking, and the docstring recommends a string.
- get_previous_close_agg() was annotated as returning one
PreviousCloseAgg, but it returns the "results" array as a list.
- list_treasury_yields(), list_short_interest(), list_short_volume() and
list_ipos() were annotated as returning a List, but like every other
list_* method they return a paginating iterator.
Hints that are imprecise but still admit every value the API sends, such
as integer timestamps hinted as float, are left alone: narrowing them
would gain little and could break callers that type-check today.
Only annotations and docstrings change; runtime behaviour is the same.
The tests pin the runtime types the corrected REST hints now describe.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
This was referenced Oct 24, 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.
Fixes #<issue: F4a>
Fixes massive-com#728 (
get_previous_close_aggreturn type).Some type hints describe values the API never sends or returns, so correct code fails type checking.
CryptoQuote.bid_price,ask_price,ask_sizeOptional[int]Optional[float](XQ sends"bp": 33052.79,"as": 0.601)IndexValue.timestampOptional[str]Optional[int](Unix ms)get_previous_close_agg()returnsPreviousCloseAggList[PreviousCloseAgg]list_treasury_yields(),list_short_interest(),list_short_volume(),vx.list_ipos()returnList[...]Iterator[...]list_tickers(cusip=...)Optional[int]Optional[Union[int, str]]cusipis widened, not changed: anintstill type-checks, and the docstring recommends a string, since CUSIPs are alphanumeric and keep leading zeros ("037833100").test_get_previous_close_aggnow asserts the result is alist, and a new test checks that the fourlist_*methods return a lazy iterator.