Skip to content

fix: silence find_header warn on optional Greeks columns (#472)#473

Merged
userFRM merged 1 commit into
mainfrom
fix/472-greeks-header-spam
May 5, 2026
Merged

fix: silence find_header warn on optional Greeks columns (#472)#473
userFRM merged 1 commit into
mainfrom
fix/472-greeks-header-spam

Conversation

@userFRM
Copy link
Copy Markdown
Owner

@userFRM userFRM commented May 5, 2026

Summary

Closes #472.

crates/thetadatadx/src/decode.rs::find_header emitted a
tracing::warn!("expected column header not found in DataTable", header=…)
on every optional column missing from a wire response. The Greeks family
splits the column set across endpoints — _first_order ships seven Greeks,
_second_order ships five, _third_order ships four — but the shared
GreeksTick schema carries the full 23-Greek union. The reporter saw
eight warn lines per row on a single option_snapshot_greeks_first_order
call from Python. Demote the diagnostic to tracing::trace! so genuine
schema-drift investigations are still reachable via
RUST_LOG=thetadatadx=trace while routine subset calls stay clean.

Required-column drift continues to surface as a typed
Error::MissingRequiredHeader from the generated parser, so the
silenced path is strictly the documented optional-column case.

Pin the per-endpoint vendor column lists for the four Greeks families
in the GreeksTick schema doc-comment, against the upstream OpenAPI
capture in scripts/upstream_openapi.yaml. The struct layout itself
is unchanged — every Greeks endpoint still returns Vec<GreeksTick>
so the SSOT pickup is doc-only and there is zero generated-SDK drift.

Add three regression tests in decode.rs::tests driving
parse_greeks_ticks against _first_order, _second_order, and
_third_order wire shapes. Each asserts bit-exact decoded values for
the wire-present columns and 0.0 defaults for the documented gaps,
so a future regression of find_header back to tracing::warn!
or any column-list drift in either direction — surfaces as a
behavioural test failure rather than as live log spam.

Per-endpoint vendor schemas pinned to:

  • _first_order: items_option_snapshot_greeks_first_order — delta, theta, vega, rho, epsilon, lambda + IV pair
  • _second_order: items_option_snapshot_greeks_second_order — gamma, vanna, charm, vomma, veta + IV pair
  • _third_order: items_option_snapshot_greeks_third_order — speed, zomma, color, ultima + IV pair (vera not in third-order)
  • _all: items_option_snapshot_greeks_all — full 23-Greek union
  • _implied_volatility: items_option_snapshot_greeks_implied_volatility — handled by IvTick

Workspace 8.0.25 → 8.0.26, tdbe 0.12.6 → 0.12.7. CHANGELOG +
docs-site/docs/changelog.md kept byte-identical.

Follow-up: per-endpoint typed structs

The bug-report comment thread also asked for per-endpoint typed
return structs (GreeksFirstOrderTick, GreeksSecondOrderTick,
GreeksThirdOrderTick) so the type system reflects the wire schema.
Surveying the surface, that change ripples through ~30 codegen
tables (build_support helpers, FFI macros with hand-tuned padding,
hand-written C++ headers, Go FFI mirrors, three SDK regenerations,
the EndpointOutput enum + every consumer in CLI / MCP / server /
ffi). It deserves its own issue + PR rather than being bolted onto a
warn-silence fix; the schema doc-comment in this PR is the
prerequisite that nails down the column lists per endpoint, so the
follow-up can map each subset to a typed struct without re-deriving
the wire shape from scratch.

Test plan

  • cargo fmt --all -- --check clean
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo test --workspace 0 failures across all crates
  • cargo deny check clean (advisories + bans + licenses + sources)
  • cargo run -p thetadatadx --bin generate_sdk_surfaces --features config-file -- --check no drift
  • Three new regression tests in decode::tests exercising the
    three Greeks subset wire shapes
  • Reporter on Issue fix(decode): silence find_header warning for optional columns #472 confirms log spam is gone after pulling
    v8.0.26

Closes #472.

The v3 server splits the Greeks column set across `option_*_greeks_*_order`
endpoints — `_first_order` ships seven Greeks, `_second_order` ships five,
and `_third_order` ships four — but the shared `GreeksTick` schema in
`tick_schema.toml` carries the full 23-Greek union. Every absent column
on a subset response triggered `tracing::warn!("expected column header
not found in DataTable", header=…)` from `find_header` in
`crates/thetadatadx/src/decode.rs`, so a single
`option_snapshot_greeks_third_order` call printed eight warn lines per
row before any user-visible decoding finished. The reporter on
Issue #472 saw the spam on every Python `option_snapshot_greeks_first_order`
call.

Demote the diagnostic to `tracing::trace!` so it stays reachable via
`RUST_LOG=thetadatadx=trace` for genuine schema-drift investigations
but stops competing with stderr on routine subset calls. Required-column
drift continues to surface as a typed `Error::MissingRequiredHeader`
from the generated parser, so the silenced path is strictly the
documented optional-column case.

Pin the per-endpoint vendor schema in the `GreeksTick` doc-comment
against the upstream OpenAPI capture (`scripts/upstream_openapi.yaml`),
so the column-list / endpoint mapping is visible from the schema file
itself rather than scattered across endpoint metadata.

Add three regression tests in `decode.rs::tests` that drive
`parse_greeks_ticks` against `_first_order`, `_second_order`, and
`_third_order` wire shapes. Each test asserts bit-exact decoded values
for every wire-present column and `0.0` defaults for the documented
gaps. A future regression of `find_header` back to `tracing::warn!`,
or any column-list drift in either direction, surfaces here as a
behavioural test failure rather than as live log spam.

Workspace 8.0.25 → 8.0.26, tdbe 0.12.6 → 0.12.7. CHANGELOG +
docs-site/docs/changelog.md kept byte-identical.

Local CI gate:

  cargo fmt --all -- --check                           # clean
  cargo clippy --workspace --all-targets -- -D warnings # clean
  cargo test --workspace                               # 0 failures
  cargo deny check                                     # advisories+bans+licenses+sources ok
  generate_sdk_surfaces --check                        # no drift

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@userFRM userFRM merged commit cae1d38 into main May 5, 2026
32 checks passed
@userFRM userFRM deleted the fix/472-greeks-header-spam branch May 5, 2026 19:33
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.

fix(decode): silence find_header warning for optional columns

1 participant