#[non_exhaustive]pub struct SemanticHints {
pub positive_columns: Vec<String>,
pub identifier_columns: Vec<String>,
pub temporal_columns: Vec<String>,
}Expand description
User-supplied semantic hints that affect profiling and quality metrics.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.positive_columns: Vec<String>§identifier_columns: Vec<String>§temporal_columns: Vec<String>Implementations§
Source§impl SemanticHints
impl SemanticHints
pub fn new( positive_columns: Vec<String>, identifier_columns: Vec<String>, ) -> Self
pub fn with_temporal_columns(self, temporal_columns: Vec<String>) -> Self
pub fn is_empty(&self) -> bool
pub fn is_identifier_column(&self, column_name: &str) -> bool
pub fn is_positive_column(&self, column_name: &str) -> bool
pub fn is_temporal_column(&self, column_name: &str) -> bool
Sourcepub fn iter(&self) -> impl Iterator<Item = (SemanticHintKind, &str)>
pub fn iter(&self) -> impl Iterator<Item = (SemanticHintKind, &str)>
Every (kind, column_name) pair across all three hint lists.
Sourcepub fn validate_names(
&self,
column_names: &[&str],
) -> Result<(), DataProfilerError>
pub fn validate_names( &self, column_names: &[&str], ) -> Result<(), DataProfilerError>
Fail loudly when a hint names a column that is not in the schema.
A hint is the user’s chosen alternative to overconfident inference, so a hint that cannot bind must not vanish: a typo’d or stale column name is a mistake the profiler should surface, not silently discard.
Sourcepub fn validate_quality_usage(
&self,
quality_computed: bool,
) -> Result<(), DataProfilerError>
pub fn validate_quality_usage( &self, quality_computed: bool, ) -> Result<(), DataProfilerError>
Reject value-driven hints when the Quality metric pack did not run.
Positive and temporal hints only affect quality calculators. Accepting them without a quality assessment would make the configuration look effective while producing neither metrics nor binding evidence.
Sourcepub fn validate_bindings(
&self,
bindings: &[SemanticHintBinding],
) -> Result<(), DataProfilerError>
pub fn validate_bindings( &self, bindings: &[SemanticHintBinding], ) -> Result<(), DataProfilerError>
Fail loudly when a hint names a real column but bound to nothing.
Only bindings that were assessed over the full data
(SemanticHintBinding::is_proven_inert) raise; sampled evidence is
carried in the report but never treated as proof of absence.
Trait Implementations§
Source§impl Clone for SemanticHints
impl Clone for SemanticHints
Source§fn clone(&self) -> SemanticHints
fn clone(&self) -> SemanticHints
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more