Convert premium.__call__ onto request_endpoint; drop data-api-dead filters (#121)#124
Merged
Merged
Conversation
…lters (#121) Route Premium.__call__ through request_endpoint("premium", **params) instead of the hand-rolled self.query path, and drop ~34 kwargs that data-api's /api/v1/premium handler never reads (they belong to the spec-excluded front-api /api/v1/front/premium). Retain the 20 kwargs backed by the codegen registry. No registry/backend changes. Remove the 5 integration tests exercising the dropped kwargs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 #121
Follow-up to #119 / PR #120 (Step 1, camelCase→snake_case wire fix). This is the deferred Step 2.
Correction to the issue premise
The issue proposed expanding the codegen registry upstream. That was investigated and dropped: verified against datamaxi-backend
mainthat the data-api/api/v1/premiumGo handler reads exactly the 21 query params already indatamaxi/_endpoints.pyoppremium. The ~34 extra kwargspremium.__call__was sending are dead — silently ignored by data-api; they belong to the spec-excluded front-api/api/v1/front/premium. So no registry/backend changes.Direction A (this PR)
Route
Premium.__call__throughself.request_endpoint("premium", **params)instead of the hand-rolledself.query("/api/v1/premium", params), and drop the dead kwargs at the signature level (request_endpointrejects any param absent from the registry).Retained kwargs (20 +
pandas): source_exchange, target_exchange, asset, source_quote, target_quote, sort, key, page, limit, currency, conversion_base, min_sv, min_tv, source_market, target_market, only_transferable, network, premium_type, token_include, token_exclude.Dropped kwargs (dead): min_pd/max_pd, all min_pdp*/max_pdp* (incl. 24h/4h/1h/30m/15m/5m), min_dsp/max_dsp, min_dtp/max_dtp, all min_spdp*/max_spdp*, max_sv, max_tv, min/max net/source/target funding-rate, source/target funding_rate_interval.
Response handling (empty-data ValueError, DataFrame flatten of
detail+ annualized funding rates,pandas=Falseraw return) unchanged.exchanges()untouched.Test plan
pytest -m "not integration": 113 passed, 11 skipped, 107 deselected.test_premium_min_pdp,test_premium_max_pdp,test_premium_min_max_pdp,test_premium_pdp24h_filters,test_premium_funding_rate_filters. Other premium integration tests (incl.test_premium_volume_filtersusing min_sv) intact.flake8+black --checkclean.# noqa: C901kept (complexity 23 > 10).