pub struct AnalysisRunner { /* private fields */ }Expand description
Orchestrates the execution of multiple analyzers on a dataset.
The AnalysisRunner optimizes execution by grouping compatible analyzers that can share computation, minimizing the number of DataFrame scans required.
§Example
ⓘ
use term_guard::analyzers::{AnalysisRunner, basic::*};
use datafusion::prelude::*;
let ctx = SessionContext::new();
// Register your data table
let runner = AnalysisRunner::new()
.add(SizeAnalyzer::new())
.add(CompletenessAnalyzer::new("user_id"))
.add(DistinctnessAnalyzer::new("user_id"))
.on_progress(|progress| {
println!("Analysis progress: {:.1}%", progress * 100.0);
});
let context = runner.run(&ctx).await?;
println!("Computed {} metrics", context.all_metrics().len());Implementations§
Source§impl AnalysisRunner
impl AnalysisRunner
Sourcepub fn on_progress<F>(self, callback: F) -> Self
pub fn on_progress<F>(self, callback: F) -> Self
Sets a progress callback that will be called during execution.
The callback receives a float between 0.0 and 1.0 indicating progress.
Sourcepub fn continue_on_error(self, continue_on_error: bool) -> Self
pub fn continue_on_error(self, continue_on_error: bool) -> Self
Sets whether to continue execution when individual analyzers fail.
Default is true (continue on error).
Sourcepub async fn run(&self, ctx: &SessionContext) -> AnalyzerResult<AnalyzerContext>
pub async fn run(&self, ctx: &SessionContext) -> AnalyzerResult<AnalyzerContext>
Executes all analyzers on the given data context.
This method optimizes execution by grouping compatible analyzers and executing them together when possible.
§Arguments
ctx- The DataFusion session context with registered data
§Returns
An AnalyzerContext containing all computed metrics and any errors
Sourcepub fn analyzer_count(&self) -> usize
pub fn analyzer_count(&self) -> usize
Returns the number of analyzers configured.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AnalysisRunner
impl !RefUnwindSafe for AnalysisRunner
impl Send for AnalysisRunner
impl Sync for AnalysisRunner
impl Unpin for AnalysisRunner
impl !UnwindSafe for AnalysisRunner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more