Skip to content

fix(premium): snake_case source/target exchange+quote wire keys#120

Merged
martinkersner merged 1 commit into
mainfrom
issue-119-fix-premium-camelcase-wire-keys
Jul 1, 2026
Merged

fix(premium): snake_case source/target exchange+quote wire keys#120
martinkersner merged 1 commit into
mainfrom
issue-119-fix-premium-camelcase-wire-keys

Conversation

@martinkersner

Copy link
Copy Markdown
Member

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_exchange
  • targetExchange -> target_exchange
  • sourceQuote -> source_quote
  • targetQuote -> target_quote

Public 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, op premium) in the upstream ../datamaxi-backend OpenAPI spec, live param-by-param verification, converting premium.__call__ onto request_endpoint, and adding tests/test_integration.py premium cases — is UPSTREAM-BLOCKED and intentionally deferred. The registry is incomplete for premium, so routing through request_endpoint (which rejects any param absent from the registry) would silently drop working filters.

Note: Closes #119 will 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 passed
  • python -m pytest -q -m "not integration" -> 113 passed, 11 skipped, 112 deselected
  • flake8 datamaxi/datamaxi/premium.py tests/test_premium.py -> clean
  • black --check on both files -> unchanged

Updated test_premium_call_param_name_translation to assert snake_case wire keys (source_exchange, target_quote) and fixed the misleading comment.

@martinkersner martinkersner self-assigned this Jul 1, 2026
@martinkersner martinkersner merged commit 8062481 into main Jul 1, 2026
7 checks passed
@martinkersner martinkersner deleted the issue-119-fix-premium-camelcase-wire-keys branch July 1, 2026 06:22
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 premium camelCase wire keys + expand registry before converting premium.__call__ onto request_endpoint

1 participant