Skip to content

Commit 4bcedc1

Browse files
userFRMclaude
andauthored
fix(docs): correct the generated client name and close the pre-release gaps (#792)
The interactive query builder generated Python and Rust snippets naming `ThetaDataDxClient`, a symbol that exists only as the C-ABI opaque handle. The Python and Rust branches now emit the real exports: `from thetadatadx import Client` / `Client(creds, config)` and `use thetadatadx::{Client, ...}` / `Client::connect(&creds, config)`. The tick schema descriptor and several examples, fixtures, and regression tests carried wire-layout provenance breadcrumbs that ship publicly through the crate `include` list. Every breadcrumb is replaced with neutral wording that keeps the useful layout note. The no-RE-framing gate previously scanned only `src/**/*.rs`; it now also covers the shipped schema descriptors, the GitHub-visible examples and tests, and asserts a planted provenance line in a schema file is caught. The docs-consistency gate now pins the client identifier the query builder emits, so a future drift back to a non-existent symbol fails the gate rather than shipping green. The unreleased worker-thread changelog entry documented method names with an `_explicit` suffix that no binding exposes; it now lists the real `setWorkerThreads` / `set_worker_threads` / `thetadatadx_config_set_worker_threads` names. The docs-site mirror stays byte-identical. `ConfigError` is a real runtime Python exception but was absent from the type stub; it is added as a `ThetaDataError` leaf alongside the other configuration and parameter exceptions. The unified client's `historical`, `stream`, and `flatFiles` view accessors were enrolled in the cross-binding parity matrix, and the method-parity check gained a reverse-orphan scan so dropping or renaming any of them in one binding fails the gate. Co-authored-by: Claude <noreply@anthropic.com>
1 parent d7374cc commit 4bcedc1

27 files changed

Lines changed: 296 additions & 98 deletions

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3535
- Columnar output — DataFrame / Arrow column names follow the public field names everywhere: `OptionContract` tables emit `symbol` (was the wire spelling `root`) and `InterestRateTick` tables emit `date` (was the wire spelling `created`), matching the row-object attributes.
3636
- HTTP server — REST responses carry the vendor's v3 field shapes for contract identity: `expiration` is an ISO `YYYY-MM-DD` string and EOD rows use the `created` / `last_trade` keys. Time-of-day values remain Eastern-Time millisecond integers paired with `date`, documented as the SDK's raw-time convention.
3737
- Python stub — the `StreamParseError` stub alias and the phantom `Error` exception stub are gone; the stub names match the runtime exactly.
38-
- The async worker-thread configuration knob is renamed to a neutral client name on every binding: Python `worker_threads`, TypeScript `setWorkerThreadsExplicit` / `workerThreads` (and the exported `WorkerThreadsSetting`), C++ `set_worker_threads_explicit` / `get_worker_threads`, and the C-ABI `thetadatadx_config_set_worker_threads_explicit` / `thetadatadx_config_get_worker_threads` (the prior names carried a runtime-internal token). The presence-plus-value ABI shape is unchanged.
38+
- The async worker-thread configuration knob is renamed to a neutral client name on every binding: Python `worker_threads`, TypeScript `setWorkerThreads` / `workerThreads` (and the exported `WorkerThreadsSetting`), C++ `set_worker_threads` / `get_worker_threads`, and the C-ABI `thetadatadx_config_set_worker_threads` / `thetadatadx_config_get_worker_threads` (the prior names carried a runtime-internal token). The presence-plus-value ABI shape is unchanged.
3939

4040
### Added
4141

crates/thetadatadx/examples/build_eod_greeks_fixtures.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
//! Build verified-live fixtures for the EOD-Greek and index-price
1+
//! Build wire-shape fixtures for the EOD-Greek and index-price
22
//! parser regression tests:
33
//! * `option_history_greeks_eod` -> `GreeksEodTick`
44
//! * `index_at_time_price` -> `IndexPriceAtTimeTick`
55
//!
66
//! Each fixture is a single `proto::ResponseData` whose `compressed_data`
77
//! is a zstd-compressed `proto::DataTable` with the EXACT wire shape the
8-
//! terminal jar build `202605221` emitted (queried via `curl
9-
//! http://127.0.0.1:25503/v3/...`).
8+
//! server emits (queried via `curl http://127.0.0.1:25503/v3/...`).
109
//!
1110
//! Headers come from the captured CSV header row; the per-row values are
1211
//! captured CSV row 1 verbatim, encoded as the same `DataValue` shapes
@@ -78,7 +77,7 @@ fn dv_text(s: &str) -> proto::DataValue {
7877
// option_history_greeks_eod -- SPY 2024-06-21 500 CALL on 2024-06-14
7978
// ────────────────────────────────────────────────────────────────────────
8079
//
81-
// CSV row 1 (verified-live from terminal jar build `202605221`):
80+
// CSV row 1 (captured from the live server):
8281
// "SPY","2024-06-21",500.000,"CALL",
8382
// 2024-06-14T16:11:12.295,41.71,42.78,40.48,42.78,683,99,
8483
// 325,5,42.39,50,418,5,43.25,50,
@@ -159,7 +158,7 @@ fn build_greeks_eod_row() -> proto::DataValueList {
159158
// index_at_time_price -- SPX 2024-06-14 10:30:00 ET
160159
// ────────────────────────────────────────────────────────────────────────
161160
//
162-
// CSV row 1 (verified-live from terminal jar build `202605221`):
161+
// CSV row 1 (captured from the live server):
163162
// 2024-06-14T10:30:00.000,0,255,255,255,255,0,0,5,5414.14
164163
//
165164
// Index prints carry sequence=0 (no SIP sequence assigned), ext_conditions

crates/thetadatadx/examples/build_trade_greeks_fixtures.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
//! Build verified-live `option_history_trade_greeks_*` fixtures used by
1+
//! Build `option_history_trade_greeks_*` fixtures used by
22
//! `tests/test_trade_greeks_schema.rs`.
33
//!
44
//! Each fixture is a single `proto::ResponseData` whose `compressed_data`
55
//! is a zstd-compressed `proto::DataTable` with the EXACT wire shape the
6-
//! terminal jar build `202605221` emitted for SPY 2026-01-16 540 CALL on
6+
//! server emits for SPY 2026-01-16 540 CALL on
77
//! 2025-05-02 (queried via `curl
88
//! http://127.0.0.1:25503/v3/option/history/trade_greeks/<sub>?...`).
99
//!

crates/thetadatadx/src/tdbe/types/generated/tick.rs

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,8 @@ impl IndexPriceAtTimeTick {
579579

580580
/// Interest rate tick -- 2 fields. End-of-day interest rate (percent).
581581
///
582+
/// Wire layout per `docs.thetadata.us/operations/interest_rate_history_eod.html`:
583+
///
582584
/// The `date` decode flows through `thetadatadx::decode::row_date`, which
583585
/// accepts `Number`, `Timestamp`, and `Text` cells uniformly — so this tick
584586
/// decodes either the documented Text-ISO shape or any future
@@ -595,6 +597,8 @@ pub struct InterestRateTick {
595597

596598
/// Implied volatility tick -- 14 fields.
597599
///
600+
/// The `option_history_greeks_implied_volatility` wire columns map as:
601+
///
598602
/// The snapshot variant (`option_snapshot_greeks_implied_volatility`) emits
599603
/// a 4-column subset (`ms_of_day, implied_vol, iv_error, date`); the
600604
/// generator's optional-column path defaults the missing fields to 0.0 so
@@ -691,7 +695,12 @@ impl MarketValueTick {
691695

692696
/// OHLC tick -- 12 fields. Aggregated bar data including SIP-rule VWAP.
693697
///
694-
/// The snapshot variants (`*_snapshot_ohlc`) omit `vwap`; the generated parser's optional-column path defaults the field to `0.0` for those endpoints, mirroring how `volume`/`count` already zero-default on quote-only intraday bars.
698+
/// `stock_history_ohlc`, `option_history_ohlc`, and `index_history_ohlc`
699+
/// emit the same 8 data columns (`timestamp,open,high,low,close,
700+
/// volume,count,vwap`). The snapshot variants (`*_snapshot_ohlc`) omit
701+
/// `vwap`; the generated parser's optional-column path defaults the
702+
/// field to `0.0` for those endpoints, mirroring how `volume`/`count`
703+
/// already zero-default on quote-only intraday bars.
695704
#[must_use]
696705
#[derive(Debug, Clone, Copy)]
697706
#[repr(C, align(64))]
@@ -977,7 +986,9 @@ impl TradeGreeksAllTick {
977986
}
978987
}
979988

980-
/// Per-trade first-order Greeks tick (delta / theta / vega / rho / epsilon / lambda) paired with the trade-side execution columns identifying the OPRA print each Greek was calculated against.
989+
/// Per-trade first-order Greeks tick (delta / theta / vega / rho / epsilon
990+
/// / lambda) paired with the trade-side execution columns identifying the
991+
/// OPRA print each Greek was calculated against.
981992
#[must_use]
982993
#[derive(Debug, Clone, Copy)]
983994
#[repr(C, align(64))]
@@ -1053,7 +1064,10 @@ impl TradeGreeksFirstOrderTick {
10531064
}
10541065
}
10551066

1056-
/// Per-trade implied-volatility tick (single `implied_volatility` + `iv_error` pair, NOT the bid/mid/ask IV triple of the interval-sampled `IvTick`) paired with the trade-side execution columns identifying the OPRA print the IV was calculated against.
1067+
/// Per-trade implied-volatility tick (single `implied_volatility` +
1068+
/// `iv_error` pair, NOT the bid/mid/ask IV triple of the interval-sampled
1069+
/// `IvTick`) paired with the trade-side execution columns identifying the
1070+
/// OPRA print the IV was calculated against.
10571071
#[must_use]
10581072
#[derive(Debug, Clone, Copy)]
10591073
#[repr(C, align(64))]
@@ -1117,7 +1131,9 @@ impl TradeGreeksImpliedVolatilityTick {
11171131
}
11181132
}
11191133

1120-
/// Per-trade second-order Greeks tick (gamma / vanna / charm / vomma / veta) paired with the trade-side execution columns identifying the OPRA print each Greek was calculated against.
1134+
/// Per-trade second-order Greeks tick (gamma / vanna / charm / vomma /
1135+
/// veta) paired with the trade-side execution columns identifying the OPRA
1136+
/// print each Greek was calculated against.
11211137
#[must_use]
11221138
#[derive(Debug, Clone, Copy)]
11231139
#[repr(C, align(64))]
@@ -1191,7 +1207,10 @@ impl TradeGreeksSecondOrderTick {
11911207
}
11921208
}
11931209

1194-
/// Per-trade third-order Greeks tick (speed / zomma / color / ultima) paired with the trade-side execution columns identifying the OPRA print each Greek was calculated against. The vendor's third-order schema does not publish `vera`.
1210+
/// Per-trade third-order Greeks tick (speed / zomma / color / ultima)
1211+
/// paired with the trade-side execution columns identifying the OPRA print
1212+
/// each Greek was calculated against. The vendor's third-order schema does
1213+
/// not publish `vera`.
11951214
#[must_use]
11961215
#[derive(Debug, Clone, Copy)]
11971216
#[repr(C, align(64))]

crates/thetadatadx/tests/fixtures/captures/index_at_time_price.meta.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Verified-live wire shape captured via the terminal jar build `202605221`:
1+
# Wire shape captured from the live server:
22
# curl 'http://127.0.0.1:25503/v3/index/at_time/price?symbol=SPX&\
33
# start_date=20240614&end_date=20240614&time_of_day=10:30:00'
44
# Synthesised into a single-row `proto::ResponseData` by the

crates/thetadatadx/tests/fixtures/captures/option_history_greeks_eod.meta.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Verified-live wire shape captured via the terminal jar build `202605221`:
1+
# Wire shape captured from the live server:
22
# curl http://127.0.0.1:25503/v3/option/history/greeks/eod?\
33
# symbol=SPY&expiration=20240621&start_date=20240614&end_date=20240614
44
# Synthesised into a single-row `proto::ResponseData` by the

crates/thetadatadx/tests/fixtures/captures/option_history_trade_greeks_all.meta.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Verified-live wire shape captured via the terminal jar build `202605221`:
1+
# Wire shape captured from the live server:
22
# curl http://127.0.0.1:25503/v3/option/history/trade_greeks/all?\
33
# symbol=SPY&expiration=20260116&start_date=20250502&end_date=20250502&\
44
# right=C&strike=540

crates/thetadatadx/tests/fixtures/captures/option_history_trade_greeks_first_order.meta.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Verified-live wire shape captured via the terminal jar build `202605221`.
1+
# Wire shape captured from the live server.
22
# Synthesised by `build_trade_greeks_fixtures` for the same SPY 2026-01-16
33
# 540 CALL print as the `_all` capture.
44

crates/thetadatadx/tests/fixtures/captures/option_history_trade_greeks_implied_volatility.meta.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Verified-live wire shape captured via the terminal jar build `202605221`.
1+
# Wire shape captured from the live server.
22
# Synthesised by `build_trade_greeks_fixtures` for the same SPY 2026-01-16
33
# 540 CALL print as the `_all` capture. The IV variant ships only the
44
# single `implied_vol` + `iv_error` pair (NOT the bid/mid/ask IV triple

crates/thetadatadx/tests/fixtures/captures/option_history_trade_greeks_second_order.meta.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Verified-live wire shape captured via the terminal jar build `202605221`.
1+
# Wire shape captured from the live server.
22
# Synthesised by `build_trade_greeks_fixtures` for the same SPY 2026-01-16
33
# 540 CALL print as the `_all` capture.
44

0 commit comments

Comments
 (0)