Repository navigation
sdk-sync: API 2.0.0+ffb34b7 → sdk-py (minor) - #176
marketdata-sdk-sync[bot] wants to merge 1 commit into
Conversation
tests: Added tests for the `dte` query parameter of `GET /v1/options/chain/{underlying}/`, widened from integer to a string expression matching strike/delta syntax. Wire tests in test_chain_filters.py cover the single-value regression plus the three new forms (comma list, closed range, comparison operator `>=`/`<`) across all four output formats. Live tests in test_options_live.py cover the same forms against the real API, deriving boundary values from actual expirations rather than guessed constants, and assert inclusive/exclusive boundary behavior for the range and operator forms. No validation tests were added since `days_to_expiration` is an existing field and the delta adds no new public symbol; wrote build/sdk-sync-compat/probe.py covering the existing `OptionsChainInput(dte=...)` constructor with today's `int` type.
implement: Widened `OptionsChainInput.days_to_expiration` (alias `dte`) from `int | None` to `int | str | None`: the plain int form still works unchanged, and a string now carries the API's expression syntax (comma list, closed range, comparison operator), matching `strike`/`delta`.
- Doc comment/example: updated the field's `description` and added a "Filter by days to expiration" example in docs/options.md, mirroring the strike/delta style.
- Every new public member documented: no new method/class was added, only the existing field's description, which is updated.
- Wire test per form: test_chain_filters.py covers single value (regression), comma list, closed range, `>=`, `<`, each across all four output formats.
- New-type validation on every path, empty/null elements: not applicable, `dte` is a scalar (int/str), not a collection.
- Coverage: no `# pragma: no cover` added; full suite at 100% coverage.
- Examples/docs still correct: the strike/delta sections are untouched and still accurate.
- No unrequested client-side check: the field only widened its annotation, no new local validation, so an out-of-range or malformed value still reaches the API exactly as before.
- Existing parameter keeps its old form: `days_to_expiration=30` (int) still type-checks and sends `dte=30`; confirmed with the compatibility probe against the widened field.
Left as-is: README.md and the other options-chain tests/files only mention the unrelated response-side `dte` field (`list[int]`) or unrelated resources, not this query parameter, so nothing there was wrong or incomplete.
review fix 1: Fixed the two major findings: reworded the `days_to_expiration` description in docs/options.md and src/marketdata/input_types/options.py to the repo's own grammar — a closed range is inclusive, `>=`/`<=`/`>`/`<` are a one-sided bound, dropping the false claim that operators are inclusive — and added `test_dte_closed_range_spans_every_expiration_within_its_bounds` to test_options_live.py, which builds its range from two independent single-value baseline calls (dte=15, dte=45) and asserts every returned dte is within [low, high], both bounds are present, and more than one expiration came back, so a server that only matched the nearest value can no longer pass it.
Resolved both actionable minor notes: added a `days_to_expiration="30"` (str) row to the wire-test parametrization in test_chain_filters.py, and added the "at most 36500" cap to both the field description and docs/options.md.
Resolved the flakiness note by making `live_chain_dte_nearest` function-scoped instead of module-scoped, so each of the boundary tests (single-value, collapsed range, `>=`, `<`) derives its own boundary from its own fresh `dte=90` call instead of reusing one call's value across several later live calls.
Left the question-for-a-person finding (the API's own description implying `<N` should be inclusive, contradicted by the live run) untouched, as instructed — no code or doc changed for it.
Reran `uv run --frozen pytest -n 4 -p no:cacheprovider --junitxml=build/test-results/pytest.xml` (2188 passed, 100% coverage) and the ruff version/check/format commands (all green) after every change.
changelog: Added changelog entry documenting that `OptionsChainInput.days_to_expiration` now accepts `str` for the API's expression syntax (comma-list, closed range, comparison operators), matching the forms of `strike` and `delta` (API release 2.0.0), with backward compatibility for `int` values.
🧾 Job log — sdk-syncsdk-auto-sync job log
Changes in the API surface1. testsCoder (30 turns, US$ 1.01, 6 min 18 s):
Gates:
2. implementCoder (28 turns, US$ 0.95, 4 min 50 s):
The pipeline:
Gates:
3. review 1Reviewer (10 turns, US$ 1.26, 2 min 49 s): 2 blocking finding(s)
4. review fix 1Findings sent back to the coder:
Minor findings sent along, as optional:
Questions for a person, shown to the coder and not for it to resolve:
Coder (20 turns, US$ 0.74, 3 min 20 s):
The pipeline:
Gates:
5. review 2Reviewer (4 turns, US$ 0.66, 48 s): approved
6. securitySecurity (4 turns, US$ 0.31, 26 s): approved
7. assessAnalyst (5 turns, US$ 0.15, 19 s) — public surface:
Computed by the pipeline: minor; changelog entry written 8. changelogCoder (5 turns, US$ 0.09, 52 s):
Gates:
Questions for a personThe internal reviewers raised these for a person to answer. They did not block the change, and the coder was not asked to resolve them.
Totals
Agent runs
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #176 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 62 62
Lines 3297 3297
=========================================
Hits 3297 3297
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
✅ Ready — Code reviewVersion impact: minor. Rating patch 6/6 (exemplary) · proof 6/6 (comprehensive) · overall 6/6 Reviewed |
Generated by sdk-auto-sync for API release 2.0.0 (commit
ffb34b7).Changes in the API surface
Snapshots
ae2b047c8f6f→c2a31e277345:What the agent did
tests: Added tests for the
dtequery parameter ofGET /v1/options/chain/{underlying}/, widened from integer to a string expression matching strike/delta syntax. Wire tests in test_chain_filters.py cover the single-value regression plus the three new forms (comma list, closed range, comparison operator>=/<) across all four output formats. Live tests in test_options_live.py cover the same forms against the real API, deriving boundary values from actual expirations rather than guessed constants, and assert inclusive/exclusive boundary behavior for the range and operator forms. No validation tests were added sincedays_to_expirationis an existing field and the delta adds no new public symbol; wrote build/sdk-sync-compat/probe.py covering the existingOptionsChainInput(dte=...)constructor with today'sinttype.implement: Widened
OptionsChainInput.days_to_expiration(aliasdte) fromint | Nonetoint | str | None: the plain int form still works unchanged, and a string now carries the API's expression syntax (comma list, closed range, comparison operator), matchingstrike/delta.descriptionand added a "Filter by days to expiration" example in docs/options.md, mirroring the strike/delta style.>=,<, each across all four output formats.dteis a scalar (int/str), not a collection.# pragma: no coveradded; full suite at 100% coverage.days_to_expiration=30(int) still type-checks and sendsdte=30; confirmed with the compatibility probe against the widened field.Left as-is: README.md and the other options-chain tests/files only mention the unrelated response-side
dtefield (list[int]) or unrelated resources, not this query parameter, so nothing there was wrong or incomplete.review fix 1: Fixed the two major findings: reworded the
days_to_expirationdescription in docs/options.md and src/marketdata/input_types/options.py to the repo's own grammar — a closed range is inclusive,>=/<=/>/<are a one-sided bound, dropping the false claim that operators are inclusive — and addedtest_dte_closed_range_spans_every_expiration_within_its_boundsto test_options_live.py, which builds its range from two independent single-value baseline calls (dte=15, dte=45) and asserts every returned dte is within [low, high], both bounds are present, and more than one expiration came back, so a server that only matched the nearest value can no longer pass it.Resolved both actionable minor notes: added a
days_to_expiration="30"(str) row to the wire-test parametrization in test_chain_filters.py, and added the "at most 36500" cap to both the field description and docs/options.md.Resolved the flakiness note by making
live_chain_dte_nearestfunction-scoped instead of module-scoped, so each of the boundary tests (single-value, collapsed range,>=,<) derives its own boundary from its own freshdte=90call instead of reusing one call's value across several later live calls.Left the question-for-a-person finding (the API's own description implying
<Nshould be inclusive, contradicted by the live run) untouched, as instructed — no code or doc changed for it.Reran
uv run --frozen pytest -n 4 -p no:cacheprovider --junitxml=build/test-results/pytest.xml(2188 passed, 100% coverage) and the ruff version/check/format commands (all green) after every change.changelog: Added changelog entry documenting that
OptionsChainInput.days_to_expirationnow acceptsstrfor the API's expression syntax (comma-list, closed range, comparison operators), matching the forms ofstrikeanddelta(API release 2.0.0), with backward compatibility forintvalues.Questions for a person
The internal reviewers raised these for a person to answer. They did not block the change, and the coder was not asked to resolve them.
src/tests/integration/test_options_live.py:189— The API's description says a comparison operator returns expirations "within the bounds, inclusive", yet the live run showsdte=<Nexcluding N (this test asserts the exclusion and passed). Request: GET /v1/options/chain/AAPL/?dte=<N; documentation: "a comparison operator (>=30, <45) returns every expiration whose dte falls within the bounds, inclusive"; response: no row with dte == N. The "syntax matches strike and delta" sentence implies the exclusion, so this needs confirming with the API team rather than fixing here.Files
CHANGELOG.mddocs/options.mdsrc/marketdata/input_types/options.pysrc/tests/integration/test_options_live.pysrc/tests/test_chain_filters.pyVersion
Public-surface change computed by the pipeline: minor
client.options.chain(days_to_expiration)— OptionsChainInput.days_to_expiration widened from int | None to int | str | None; every existing call such as client.options.chain("AAPL", days_to_expiration=30) still type-checks and behaves the same, and callers gain the ability to pass the API's comma-list, range and comparison-operator expressions as a string.Live-API suite
src/tests/integration/test_options_live.pyFiles of this suite changed by this pull request. The pipeline ran the ones the change added or modified against the live API before the pull request, and they passed; this pull request's CI runs the whole suite.
Job log
The full record of this job — every phase, test and build result, review findings and how they were resolved, and each fix round after the PR was opened — is in the job log comment.
4 coder run(s) · 3 review(s) · 106 turns · 8,942,129 tokens · US$ 5.17 · item
1380e6e8-31e3-4322-a204-207422fcb4d5Agent runs