Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rust): Ensure eprintln! is only called within debug/verbose context #15100

Merged
merged 2 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,14 @@ fn can_run_partitioned(
if from_partitioned_ds {
let estimated_cardinality = unique_estimate as f32 / original_df.height() as f32;
if estimated_cardinality < 0.4 {
eprintln!("PARTITIONED DS");
if state.verbose() {
eprintln!("PARTITIONED DS");
}
Ok(true)
} else {
eprintln!("PARTITIONED DS: estimated cardinality: {estimated_cardinality} exceeded the boundary: 0.4, running default HASH AGGREGATION");
if state.verbose() {
eprintln!("PARTITIONED DS: estimated cardinality: {estimated_cardinality} exceeded the boundary: 0.4, running default HASH AGGREGATION");
}
Ok(false)
}
} else if unique_estimate > unique_count_boundary {
Expand Down
4 changes: 3 additions & 1 deletion crates/polars-pipe/src/executors/sinks/sort/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ impl SortSink {
ooc_start: None,
};
if ooc {
eprintln!("OOC sort forced");
if verbose() {
eprintln!("OOC sort forced");
}
out.init_ooc().unwrap();
}
out
Expand Down
Loading