polars_online.PolarsOnlineDeprecationWarning

class polars_online.PolarsOnlineDeprecationWarning[source]

Bases: PolarsOnlineWarning, DeprecationWarning

A warning that a renamed name was used by its old spelling.

The old name still works, read as the new one, until the next major version, which refuses it, naming the new one. The message names both: write the new name to silence it. Python shows a DeprecationWarning issued from a library only in __main__ and under test runners, so to see it everywhere, filter it with warnings.simplefilter("default", polars_online.PolarsOnlineDeprecationWarning), and to make it an error, with "error".

A spec parameter goes through a table of renamed keys, at any depth of a spec. Any other renamed name ships a forwarding of its own that issues this warning: a check at the function’s top, a stub, an alias or a second column. That covers another function’s keyword, a function, a word a parameter takes, a flag, an environment variable, an output field and a frame column. The names renamed as the API was fixed for 1.0 are forwarded this way, and the changelog lists them. The names renamed earlier were never forwarded: each old name is refused outright, naming the new one (TypeError from a builder, ValueError from a spec dict).

Examples

import warnings

with warnings.catch_warnings(record=True) as caught:
    warnings.simplefilter("always")
    spec = po.spec.kmeans("km", features=["x0", "x1"], k=3, half_life=100.0)  # old name
print(spec["model"]["n_clusters"], [type(w.message).__name__ for w in caught])
3 ['PolarsOnlineDeprecationWarning']

See also