Skip to content

fix(accounts): forward all follower-stats params in typed override (GET-820)#25

Merged
Zernio-Elean merged 1 commit into
developfrom
fix/get-820-follower-stats-params
Jun 17, 2026
Merged

fix(accounts): forward all follower-stats params in typed override (GET-820)#25
Zernio-Elean merged 1 commit into
developfrom
fix/get-820-follower-stats-params

Conversation

@Zernio-Elean

Copy link
Copy Markdown
Contributor

What

The hand-written get_follower_stats / aget_follower_stats override in AccountsResource had a truncated signature (only account_ids) that shadowed the full generated signature via Python MRO. Any caller passing profile_id (the MCP tool accounts_get_follower_stats does) crashed with:

TypeError: AccountsResource.get_follower_stats() got an unexpected keyword argument 'profile_id'

Fix

  • Widen both overrides to the full param set: account_ids, profile_id, from_date, to_date, granularity, forwarded via _build_params (snake -> camelCase, drops None/empty).
  • account_ids accepts either a comma-separated str (the shape the MCP wrapper and REST endpoint use) or a list (joined for backwards compatibility, so existing list callers keep working). No breaking change.
  • Keep the typed FollowerStatsResponse return (the only reason the override exists).
  • Fix the stale 'stats' docstring (real model exposes accounts/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

  • New regression test test_get_follower_stats_forwards_all_params asserts all 5 params reach the URL as camelCase (would have caught GET-820).
  • Existing test_get_follower_stats keeps the list-input path covered (backwards compat).
  • pytest -k follower_stats -> 2 passed.

Refs

…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
@Zernio-Elean Zernio-Elean merged commit 11d014e into develop Jun 17, 2026
4 checks passed
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.

1 participant