Skip to content

Commit

Permalink
Prevent recursive AlreadyEncountered error formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
trueb2 committed Oct 29, 2023
1 parent 6bc3896 commit de6f290
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/polars-plan/src/logical_plan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ impl std::fmt::Display for ErrorState {
match self {
ErrorState::NotYetEncountered { err } => write!(f, "NotYetEncountered({err})")?,
ErrorState::AlreadyEncountered { prev_err_msg } => {
write!(f, "AlreadyEncountered({prev_err_msg})")?
if prev_err_msg.contains("AlreadyEncountered") {
// Recurively formatting error messages leads to N! memory usage

Check warning on line 83 in crates/polars-plan/src/logical_plan/mod.rs

View workflow job for this annotation

GitHub Actions / main

"Recurively" should be "Recursively".
write!(f, "Multiple AlreadyEncountered")?
} else {
write!(f, "AlreadyEncountered({prev_err_msg})")?
}
},
};

Expand Down

0 comments on commit de6f290

Please sign in to comment.