polars_online.WrongTypeError¶
- class polars_online.WrongTypeError[source]¶
Bases:
TypeError,ValueErrorThe error raised for a value of the wrong type where
ValueErrorwas raised before.The value may be a float where a whole number is needed, one spec where a list of them is, a text column where a number is, or a
UInt128column, which polars-online cannot read. It is aTypeError, the class for a value of the wrong type, and aValueErrortoo, the class most of these refusals raised before. TheValueErrorparent is dropped at the next major version, so catchTypeError.Examples
spec = po.spec.ewridge("m", targets=["y"], features=["x0"], half_life=50.0) try: po.ModelBank(spec) # one spec, not a list of them except TypeError as e: # or ValueError, until then print(type(e).__name__, str(e).split(".")[0])
WrongTypeError ModelBank: specs must be a list of specs, but it is one spec
See also
RefusedValueError, its counterpart for a value out of range.