Closed mdavis-xyz closed 1 month ago
Can be reproduced outside of Jupyter by forcing the .to_dot()
call:
(
pl.LazyFrame({"a": [1, 2]})
.with_columns(pl.col("b"))
.select("b")
._ldf
.to_dot(optimized=False)
)
# could not determine schema
# thread '<unnamed>' panicked at crates/polars-lazy/src/dot.rs:49:14:
# io error: Error
# PanicException: io error: Error
I think this is actually fixed on main due to https://github.com/pola-rs/polars/pull/16237
On main I get the ColumnNotFoundError as expected:
ColumnNotFoundError: b
This error occurred with the following context stack:
[1] 'with_columns' failed
[2] 'select' input failed to resolve
Yes, this is fixed.
Checks
Reproducible example
Run this in Jupyter (which automatically tries to print whatever the last line returns). Note that the column I'm selecting does not exist.
Log output
(The verbose flag didn't seem to output anything additional.)
Issue description
In Jupyter, if I have made a mistake with my polars operations (e.g. selecting a column which doesn't exist), when Jupyter tries to print the result, I get a Panic.
Note that I'm only able to reproduce the error with both
.select()
and.with_columns()
. On their own each one does not cause the Panic.Expected behavior
Since a
.collect()
would result in an error, I expect that a string representation of the lazyframe would either:LazyFrame
:My understanding is that a Panic is never the intended behavior, and that all errors should be handled more gracefully.
Installed versions