Repository navigation
docs: sync/async resource docstring drift sweep (parity) - #360
Conversation
Sweep async `*_all` iterator-factory methods across orders, markets,
portfolio, and communications so every one carries the same one-line
marker docstring ("Returns an async iterator — use ``async for``.").
Previously this marker was present on a subset (`list_all`,
`list_trades_all`, `deposits_all`, `withdrawals_all`) and missing on
others (`fills_all`, `settlements_all`, `list_all_rfqs`,
`list_all_quotes`), letting users primed by `await client.orders.list`
trip over `TypeError: object AsyncIterator can't be used in 'await'`
without any in-source hint.
Pull the `event_positions` caveat and the FCM/403/demo-parity note from
`PortfolioResource` over to their `AsyncPortfolioResource` counterparts
so Sphinx / IDE hover renders the same guidance on both surfaces.
Replace the phantom `FixedPointDollars` reference in the
`CreateOrderV2Request` docstring with `DollarDecimal` (the actual
type the field is annotated with).
Closes #334, #337, #338, #339
Code ReviewSummary: Docstring-only sweep closing Round-3 audit findings (#334, #337, #338, #339). No behavioral changes; all four targeted issues are addressed correctly. What looks good
IssuesMinor:
|
| File | Method |
|---|---|
historical.py |
All four async *_all methods (lines 361, 437, 483, 531) — no docstring at all |
events.py |
Both async list_all / list_all_series methods (lines 243, 294) — no docstring |
multivariate.py |
Async list_all (line 320) — no docstring |
subaccounts.py |
Async transfers_all (line 310) — only a # Plain def comment, no docstring |
These are plausibly Round-4 material if the audit continues.
Nitpick: hardcoded audit reference in total_resting_order_value
"""… demo mirrors prod on this route per Path B audit (2026-04-18)."""The date and "Path B audit" label are internal provenance that won't mean anything to an SDK consumer reading the rendered docs. It's already in the sync docstring so this PR just copies it — fine for now — but worth cleaning up when the sync version is next touched.
Verdict
The four targeted issues are fixed correctly and the changes are minimal. The positions_all missing sentence is a small gap worth fixing before merge; everything else is observational. Approve after addressing that one sentence.
|
Round-2 review addressed in 83a227f:
Deferred (not addressed in this PR):
|
Code Review — PR #360: sync/async resource docstring drift sweepVerdict: Approve with minor suggestions. Clean, well-scoped, no runtime risk. OverviewDocstring-only PR closing four tracked issues:
All affected files confirm the changes look correct in context. Positive
Minor concerns1. Internal audit reference in # current
"""Total value of resting orders in cents. FCM-members only.
Non-FCM accounts receive 403; demo mirrors prod on this route
per Path B audit (2026-04-18).
"""
"""Total value of resting orders in cents. FCM-members only.
Non-FCM accounts receive 403. Demo mirrors prod on this route.
"""2. "Mirrors :meth:
3. Remaining async-iterator methods without the marker (out of scope, but worth tracking) This sweep covers orders/markets/portfolio/communications. Four resource files still have async
If those aren't covered by existing open issues, worth filing a follow-up rather than leaving the audit incomplete. SummaryThe |
Summary
Docstring-only sweep that closes Round-3 audit findings about sync/async docstring drift on the resource classes. Every async
*_alliterator-factory method now carries the same one-line marker telling callers to useasync for(notawait); the two async portfolio methods that had abbreviated docstrings relative to their sync counterparts now carry the same prose; and one stale type reference (FixedPointDollars) in theCreateOrderV2Requestdocstring is replaced with the real Python alias (DollarDecimal).Issues closed
*_alliterator-factory marker docstrings standardized across orders/markets/portfolio/communicationsAsyncPortfolioResource.positions_allcarries theevent_positionscaveattotal_resting_order_valuedocstring drops the FCM/403/demo-parity note the sync has #338 —AsyncPortfolioResource.total_resting_order_valuecarries the FCM/403/demo-parity noteCreateOrderV2Requestdocstring referencesDollarDecimal(the real alias) instead of the nonexistentFixedPointDollarsBehavioral changes
None — docstrings only. No signatures, no imports, no runtime behavior touched.
Tests
None added — docstring-only PR.
ruffandmypypass clean on the touched files.Source
Round-3 independent audit closure plan, wave W0.