Skip to content

LiveDataResource.get_typed is the legacy URL form — name implies type-safety, not legacy #336

Closed

Description

@TexasCoding

Problem

The method is named get_typed, which suggests a more-strongly-typed variant of get. In reality the only difference is the URL: get_typed hits the legacy /live_data/{type}/milestone/{milestone_id} path, while get hits the canonical /live_data/milestone/{milestone_id}. Both return the same LiveData model with the same annotations. The docstring acknowledges this with "Legacy ..." and "Prefer :meth:get.", but a reader scanning autocomplete will likely reach for the newer-sounding get_typed over get when the opposite is correct.

Evidence

  • kalshi/resources/live_data.py:43-68
def get_typed(
    self,
    milestone_type: str,
    milestone_id: str,
    ...
) -> LiveData:
    """Legacy ``/live_data/{type}/milestone/{milestone_id}`` shape.
    ...
    Prefer :meth:`get`. The spec marks this endpoint as the legacy
    form retained for backward compatibility.
    """
  • docs/resources/live-data.md:54 — section heading already labels it Legacy get_typed.

Suggested fix

Rename get_typed → get_legacy (or get_by_type) on both LiveDataResource and AsyncLiveDataResource. Keep get_typed as a one-version DeprecationWarning alias that forwards to the new name. Update the docs/resources/live-data.md section heading and surface the new name in any export lists.

Source

Round-3 independent audit (reviewer: resources_api).

Activity

  1. added
    documentationImprovements or additions to documentation
    polishCode-quality and DX improvements; non-functional
    on May 22, 2026
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

    documentationImprovements or additions to documentationpolishCode-quality and DX improvements; non-functional

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions