fix(premium): snake_case source/target exchange+quote wire keys#120
Merged
Merged
Conversation
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.
Closes #119 (partial: Step 1 only)
Summary
premium.__call__hand-translated 4 snake_case Python kwargs into camelCase wire keys, which the snake_case backend silently ignored — so source/target exchange + quote filtering was broken against the live API. Fixed the 4 wire keys to snake_case:sourceExchange->source_exchangetargetExchange->target_exchangesourceQuote->source_quotetargetQuote->target_quotePublic Python kwargs were already snake_case; only the wire keys were wrong. All other params already used snake_case keys and are untouched.
self.query("/api/v1/premium", params)left in place.Deferred (NOT in this PR)
Step 2 — expanding the codegen registry (
datamaxi/_endpoints.py, oppremium) in the upstream../datamaxi-backendOpenAPI spec, live param-by-param verification, convertingpremium.__call__ontorequest_endpoint, and addingtests/test_integration.pypremium cases — is UPSTREAM-BLOCKED and intentionally deferred. The registry is incomplete for premium, so routing throughrequest_endpoint(which rejects any param absent from the registry) would silently drop working filters.Note:
Closes #119will auto-close this issue on merge. A follow-up issue should track deferred Step 2.Test plan
python -m pytest tests/test_premium.py -q -m "not integration"-> 6 passedpython -m pytest -q -m "not integration"-> 113 passed, 11 skipped, 112 deselectedflake8 datamaxi/datamaxi/premium.py tests/test_premium.py-> cleanblack --checkon both files -> unchangedUpdated
test_premium_call_param_name_translationto assert snake_case wire keys (source_exchange,target_quote) and fixed the misleading comment.