polars_online.OutputColumnNotFoundError¶
- class polars_online.OutputColumnNotFoundError[source]¶
Bases:
ColumnNotFoundError,KeyErrorThe error raised when a spec’s output column is not in the frame a scoring function reads.
It is a
ColumnNotFoundError, so Polars’ ownColumnNotFoundErrorandValueErrorcatch it, as they catch any other missing column. It is aKeyErrortoo, the class this refusal raised before. That parent is dropped at the next major version, so catchColumnNotFoundError. Its text, like anyKeyError’s, prints in quotes.Examples
This code reads
dffrom Example data:try: po.eval.metrics(df, "ridge") # a frame without the bank's output except pl.exceptions.ColumnNotFoundError as e: # or KeyError, until then print(type(e).__name__)
OutputColumnNotFoundError
See also
polars_online.eval.metrics()and the other scoring functions ofpolars_online.eval, which raise it.