Skip to content

list_trades_all vs list_all_rfqs — two *_all naming conventions coexist in the same SDK #349

Closed

Description

@TexasCoding

Problem

When a list method has a noun suffix, two patterns coexist in this codebase: list_X paired with list_all_X (communications.list_rfqs / list_all_rfqs, communications.list_quotes / list_all_quotes, subaccounts.list_transfers / list_all_transfers) and list_X paired with list_X_all (markets.list_trades / list_trades_all). Both shapes appear in user-facing docs.

Consequence: a caller who learned the SDK on CommunicationsResource reaches for client.markets.list_all_trades(...) and gets AttributeError. It is also a documentation footgun — docs/resources/index has both spellings within a few rows of each other.

Evidence

  • kalshi/resources/markets.py:339,360 — list_trades / list_trades_all (suffix _all).
  • kalshi/resources/communications.py:213,241,334,374 — list_rfqs / list_all_rfqs, list_quotes / list_all_quotes (prefix _all_).
  • kalshi/resources/subaccounts.py:157,175 — list_transfers / list_all_transfers (prefix _all_).

Suggested fix

Standardize on list_all_<noun> (the form used by three of the four resources). Rename markets.list_trades_all → list_all_trades on sync + async, add a one-version deprecation alias (@typing_extensions.deprecated) that forwards to the new name, and update docs/resources/markets.md. Add a regression test that imports both the old and new names and asserts the deprecation warning fires.

Source

Round-3 independent audit (reviewer: resources_api).

Activity

  1. added
    polishCode-quality and DX improvements; non-functional
    breakingBackwards-incompatible change
    on May 22, 2026
  2. added this to the v3.0.0 milestone on May 22, 2026
  3. TexasCoding commented on May 22, 2026

    @TexasCoding
    OwnerAuthor

    Deferred to v3.0.0 per Round-3 audit closure plan.

    Reason: this change renames public methods, so it cannot ship in a v2.x minor without adding deprecation aliases + warnings + alias tests for every renamed symbol. Bundling all such renames into v3.0.0 keeps v2.7 a clean polish release and avoids alias drift.

    Linked plan: /tmp/kalshi-review-r3/PLAN.md Wave 4. Re-opens (well, stays open) for scheduling when v3.0.0 work begins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingBackwards-incompatible changepolishCode-quality and DX improvements; non-functional

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions