snake_case query params: send top_n / min_volume_usd#80
Merged
Conversation
…keys Align public query params with backend snake_case canonical (dual-read). Wire keys top_n + min_volume_usd; public topN kwarg kept (non-breaking).
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.
Summary
Aligns the Python SDK with the backend snake_case query-param migration (#7343 / PR #7356 / #7359, docs #7365).
top_n/min_volume_usdare PERMANENT public params (data-api + MCP); the SDK was still sending the old camelCase keys.Not an outage fix — backend dual-read still accepts camelCase. Canonical-alignment cleanup.
Changes
liquidation.pyheatmap()wire keytopN→top_n.open_interest.pysummary()wire keytopN→top_n._endpoints.pymetadata keystopN→top_n(×2),minVolumeUsd→min_volume_usd(×2).Design choice — Option A (keep public kwarg, snake_case only the wire key)
Kept the user-facing
topNkwarg as-is and changed only the query-string key sent to the server. Zero breaking change; the issue explicitly allows user-facing names to stay. Renaming the kwarg would break existing callers for no behavioral gain. No SDK method exposes aminVolumeUsdkwarg, so only its metadata key needed renaming._endpoints.pycodegen finding_endpoints.pyis generated (make pythonfromopenapi.yaml) — the generator/spec live upstream in the backend repo, not in this repo, so there is no local regen path here. The backend OpenAPI source (cmd/data-api/docs/openapi.yaml) already emitstop_n/min_volume_usdas of #7365; the committed_endpoints.pywas simply regenerated before that update and went stale. This is a manual edit that catches the SDK up — the nextmake pythonrun reconciles cleanly (it will reproduce these same snake_case keys). I did not fabricate a codegen run.Test plan
tests/test_query_params.py— offlineresponses-mocked tests assertingheatmap/summarysendtop_non the wire (andtopNis absent).python -m pytest tests/test_query_params.py tests/test_api.py -v→ 10 passed.flake8 datamaxi/datamaxi/liquidation.py datamaxi/datamaxi/open_interest.py datamaxi/_endpoints.py tests/test_query_params.py→ clean.test_call.py/test_integration.pyskip withoutDATAMAXI_API_KEY.)Closes Bisonai/datamaxi-backend#7398