fix(accounts): forward all follower-stats params in typed override (GET-820)#25
Merged
Merged
Conversation
…ET-820) The hand-written get_follower_stats/aget_follower_stats override dropped profile_id/from_date/to_date/granularity, shadowing the generated signature via MRO and raising TypeError when callers passed them. Widen both to the full param set and forward via _build_params. account_ids accepts either a comma-separated str (MCP + REST shape) or a list (joined for backwards compat). Adds a regression test asserting all 5 params reach the URL as camelCase. Ticket: GET-820 Crisp: session_30e968e1-b064-4020-9c16-dd9ff655b5df
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.
What
The hand-written
get_follower_stats/aget_follower_statsoverride inAccountsResourcehad a truncated signature (onlyaccount_ids) that shadowed the full generated signature via Python MRO. Any caller passingprofile_id(the MCP toolaccounts_get_follower_statsdoes) crashed with:Fix
account_ids,profile_id,from_date,to_date,granularity, forwarded via_build_params(snake -> camelCase, drops None/empty).account_idsaccepts either a comma-separatedstr(the shape the MCP wrapper and REST endpoint use) or alist(joined for backwards compatibility, so existing list callers keep working). No breaking change.FollowerStatsResponsereturn (the only reason the override exists).'stats'docstring (real model exposesaccounts/dateRange/aggregation).Why it happened
The override was left behind when the OpenAPI client was regenerated with the new params. Hand overrides of generated resources are MRO time-bombs: a param dropped on the next regen silently re-introduces this TypeError. A WHY comment now flags that the signature must stay mirrored.
Tests
test_get_follower_stats_forwards_all_paramsasserts all 5 params reach the URL as camelCase (would have caught GET-820).test_get_follower_statskeeps the list-input path covered (backwards compat).pytest -k follower_stats-> 2 passed.Refs