Skip to content

Commit

Permalink
feat(rust): access OptState in LazyFrame to unit-test optimizatio…
Browse files Browse the repository at this point in the history
…n toggle methods. (#9883)
  • Loading branch information
sorhawell authored Jul 14, 2023
1 parent 147944c commit 134d43e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion polars/polars-lazy/polars-plan/src/frame/opt_state.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Copy, Clone)]
#[derive(Copy, Clone, Debug)]
/// State of the allowed optimizations
pub struct OptState {
pub projection_pushdown: bool,
Expand Down
5 changes: 5 additions & 0 deletions polars/polars-lazy/src/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ impl LazyFrame {
}
}

/// Get current optimizations
pub fn get_current_optimizations(&self) -> OptState {
self.opt_state
}

/// Set allowed optimizations
pub fn with_optimizations(mut self, opt_state: OptState) -> Self {
self.opt_state = opt_state;
Expand Down

0 comments on commit 134d43e

Please sign in to comment.