Skip to content

Commit

Permalink
fix: Ensure profile of simple-projection only take own runtime (#15671)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 authored Apr 15, 2024
1 parent 19f0939 commit 8ef2e21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl Executor for ProjectionExec {
)
})
.collect::<PolarsResult<Vec<_>>>()?;
let name = comma_delimited("projection".to_string(), &by);
let name = comma_delimited("select".to_string(), &by);
Cow::Owned(name)
} else {
Cow::Borrowed("")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ pub struct ProjectionSimple {
}

impl ProjectionSimple {
fn execute_impl(
&mut self,
state: &mut ExecutionState,
columns: &[SmartString],
) -> PolarsResult<DataFrame> {
let df = self.input.execute(state)?;
fn execute_impl(&mut self, df: DataFrame, columns: &[SmartString]) -> PolarsResult<DataFrame> {
if self.duplicate_check {
df._select_impl(columns.as_ref())
} else {
Expand All @@ -29,17 +24,17 @@ impl Executor for ProjectionSimple {
let columns = self.columns.iter_names().cloned().collect::<Vec<_>>();

let profile_name = if state.has_node_timer() {
let name = comma_delimited("projection".to_string(), &columns);
let name = comma_delimited("simple-projection".to_string(), &columns);
Cow::Owned(name)
} else {
Cow::Borrowed("")
};
let df = self.input.execute(state)?;

if state.has_node_timer() {
let new_state = state.clone();
new_state.record(|| self.execute_impl(state, &columns), profile_name)
state.record(|| self.execute_impl(df, &columns), profile_name)
} else {
self.execute_impl(state, &columns)
self.execute_impl(df, &columns)
}
}
}

0 comments on commit 8ef2e21

Please sign in to comment.