invr 0.2.3

Declarative data validation engine using invariants executed on Polars DataFrames.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::interface::yaml::dto::scope::ScopeYaml;
use crate::scope::Scope;
use crate::scope::error::ScopeError;

impl TryFrom<ScopeYaml> for Scope {
    type Error = ScopeError;

    fn try_from(value: ScopeYaml) -> Result<Self, Self::Error> {
        match value {
            ScopeYaml::Dataset => Ok(Scope::Dataset),
            ScopeYaml::Column { name } => Ok(Scope::Column { name }),
        }
    }
}