Skip to content

Unify deprecation warnings behind one helper #1950

Description

@dmpetrov

src/ has 8 warnings.warn calls and no convention: SignalSchemaWarning ×3,
UserWarning, RuntimeWarning, DeprecationWarning (DataChain.print_schema),
FutureWarning (legacy _type_tag, #1824), and one call with no category at all
(llm/spec.py:46). No helper, no removal policy, no changelog convention.

Do: add one helper — e.g. warn_deprecated(what, *, instead=None, removal=None, once=False) — that fixes the category, keeps messages to one line in a single shape
("X is deprecated; use Y instead."), and supports once-per-process for hot paths such
as row readers. Migrate the existing sites.

Decide: the category rule. DeprecationWarning is hidden by default outside
__main__, so anything a user must act on (data formats, public API) needs
FutureWarning; internal/dev-facing deprecations can stay DeprecationWarning.
Then document when a deprecation may be removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions