Skip to content

Commit

Permalink
add did error for csv
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite committed Feb 11, 2025
1 parent 2d4a575 commit f81466f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/polars-stream/src/nodes/io_sources/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,17 @@ impl SourceNode for CsvSourceNode {
}

let mut is_finished = true;
let mut did_error = false;

for (outcome, wait_group) in morsel_outcomes.into_iter() {
wait_group.wait().await;
is_finished &= !matches!(outcome.decide(), PhaseOutcome::Stopped);
is_finished &= matches!(outcome.decide(), PhaseOutcome::Finished);
did_error |= matches!(outcome.decide(), PhaseOutcome::Error);
}

if did_error {
return Ok(());
}
if is_finished {
phase_output.outcome.finish();
break;
Expand Down

0 comments on commit f81466f

Please sign in to comment.