polars_online.RefusedValueError

class polars_online.RefusedValueError[source]

Bases: ValueError, TypeError

The error raised for a refused value where TypeError was raised before.

The value is out of range, or a combination of settings is refused, such as reverse=True with no window_size to end the rows read ahead. It is a ValueError, the class for a value out of range or a combination refused, and a TypeError too, the class these refusals raised before. The TypeError parent is dropped at the next major version, so catch ValueError.

Examples

try:
    po.ewm_mean("x", half_life=10.0, reverse=True)   # no window_size
except ValueError as e:   # or TypeError, until then
    print(type(e).__name__, str(e).split(",")[0])
RefusedValueError po.ewm_mean: reverse=True needs window_size

See also