diff --git a/example-dagster-pipes-rust-project/rust_processing_jobs/src/main.rs b/example-dagster-pipes-rust-project/rust_processing_jobs/src/main.rs index 40e739c..b5b07f3 100644 --- a/example-dagster-pipes-rust-project/rust_processing_jobs/src/main.rs +++ b/example-dagster-pipes-rust-project/rust_processing_jobs/src/main.rs @@ -8,10 +8,7 @@ fn main() -> Result<(), DagsterPipesError> { let asset_metadata = HashMap::from([( "row_count".to_string(), - PipesMetadataValue { - raw_value: Some(RawValue::Integer(100)), - pipes_metadata_value_type: Some(Type::Int), - }, + PipesMetadataValue::new(RawValue::Integer(100), Type::Int), )]); context.report_asset_materialization("example_rust_subprocess_asset", asset_metadata); diff --git a/src/lib.rs b/src/lib.rs index 549a993..0f33063 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -33,6 +33,15 @@ pub enum AssetCheckSeverity { Error, } +impl PipesMetadataValue { + pub fn new(raw_value: types::RawValue, pipes_metadata_value_type: types::Type) -> Self { + Self { + raw_value: Some(raw_value), + pipes_metadata_value_type: Some(pipes_metadata_value_type), + } + } +} + // partial translation of // https://github.com/dagster-io/dagster/blob/258d9ca0db/python_modules/dagster-pipes/dagster_pipes/__init__.py#L859-L871 #[derive(Debug)]