Repository navigation
feat(economics): make treasury tenors and calendar figures optional - #385
Merged
Merged
Conversation
The live economics endpoints return `null` for treasury rate tenors, indicator values, and several calendar figures on upcoming or partial releases (issue #368). Decoding these rows previously failed the whole call because the members were required numeric types. **Response model changes:** * Made all twelve `TreasuryRate` tenors, `EconomicIndicatorObservation.value`, and the `previous`, `estimate`, `actual`, `change`, `changePercentage`, and `unit` members of `EconomicCalendarEvent` optional across Rust, Go, and Python. * Added a `required_option` deserializer in the Rust responses so a `null` decodes to `None` while a missing key still fails. * Reworked the Go shadow decoders to use `jsontext.Value` so a present-but-null member is distinguished from an absent one and mapped to a nil pointer. **Tests and docs:** * Updated fixtures and parity tests to assert null tenors, values, and calendar figures decode as `None`/`nil`, and extended the contract checks to accept null only for the newly optional members. * Documented the null-figure ambiguity for the economics calendar, treasury tenors, and indicator value in the contract-ambiguities table. BREAKING CHANGE: TreasuryRate tenors, EconomicIndicatorObservation.value and six EconomicCalendarEvent members are now optional (Option / pointer / Optional); handle None. Refs: #368
benbenbang
enabled auto-merge (rebase)
September 30, 2026 12:52
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.
The live economics endpoints return
nullfor treasury rate tenors,indicator values, and several calendar figures on upcoming or partial
releases (issue #368). Decoding these rows previously failed the whole
call because the members were required numeric types.
Response model changes:
TreasuryRatetenors,EconomicIndicatorObservation.value, and theprevious,estimate,actual,change,changePercentage, andunitmembers ofEconomicCalendarEventoptional across Rust, Go, and Python.required_optiondeserializer in the Rust responses so anulldecodes toNonewhile a missing key still fails.jsontext.Valueso a present-but-null member is distinguished from an absent one and mapped to a nil pointer.Tests and docs:
None/nil, and extended the contract checks to accept null only for the newly optional members.BREAKING CHANGE: TreasuryRate tenors, EconomicIndicatorObservation.value
and six EconomicCalendarEvent members are now optional (Option / pointer
/ Optional); handle None.
Refs: #368