From 1eec590e7028ce5f924dbeddd1b65347260e1f93 Mon Sep 17 00:00:00 2001 From: Esteban Borai Date: Fri, 22 Nov 2024 20:14:41 -0300 Subject: [PATCH] chore: update versions for refs (#4271) * chore: update versions for refs * fix: update `fluvio-smartengine` version * fix: test config file --- crates/fluvio-smartengine/Cargo.toml | 2 +- .../fluvio-smartengine/src/transformation.rs | 31 +++++++++---------- .../testdata/transformation/full.yaml | 6 ++-- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/crates/fluvio-smartengine/Cargo.toml b/crates/fluvio-smartengine/Cargo.toml index 0f8cde3e32..2548e3acef 100644 --- a/crates/fluvio-smartengine/Cargo.toml +++ b/crates/fluvio-smartengine/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fluvio-smartengine" -version = "0.8.2" +version = "0.8.3" edition = "2021" license = "Apache-2.0" authors = ["Fluvio Contributors "] diff --git a/crates/fluvio-smartengine/src/transformation.rs b/crates/fluvio-smartengine/src/transformation.rs index c83ffb2c27..ecdf139b2a 100644 --- a/crates/fluvio-smartengine/src/transformation.rs +++ b/crates/fluvio-smartengine/src/transformation.rs @@ -1,12 +1,11 @@ -use std::{ - collections::BTreeMap, - fmt::{self, Display}, - path::PathBuf, - fs::File, - io::Read, - ops::Deref, - time::Duration, -}; +use std::collections::BTreeMap; +use std::fmt::{self, Display}; +use std::path::PathBuf; +use std::fs::File; +use std::io::Read; +use std::ops::Deref; +use std::time::Duration; + use serde::{ Deserialize, Serialize, Deserializer, de::{Visitor, self, SeqAccess, MapAccess}, @@ -197,7 +196,7 @@ mod tests { TransformationConfig { transforms: vec![ TransformationStep { - uses: "infinyon/jolt@0.1.0".to_string(), + uses: "infinyon/jolt@0.4.1".to_string(), lookback: Some(Lookback{ last: 0, age: Some(Duration::from_secs(3600 * 24 * 7)) }), with: BTreeMap::from([( "spec".to_string(), @@ -205,7 +204,7 @@ mod tests { )]) }, TransformationStep { - uses: "infinyon/jolt@0.1.0".to_string(), + uses: "infinyon/jolt@0.4.1".to_string(), lookback: Some(Lookback{ last: 1, age: None }), with: BTreeMap::from([( "spec".to_string(), @@ -213,7 +212,7 @@ mod tests { )]) }, TransformationStep { - uses: "infinyon/json-sql@0.1.0".to_string(), + uses: "infinyon/json-sql@0.2.1".to_string(), lookback: Some(Lookback{ last: 10, age: Some(Duration::from_secs(12)) }), with: BTreeMap::from([( "mapping".to_string(), @@ -240,8 +239,8 @@ mod tests { fn test_from_vec() { //given let vec = vec![ - r#"{"uses":"infinyon/jolt@0.1.0","invoke":"insert","with":{"spec":"[{\"operation\":\"remove\",\"spec\":{\"length\":\"\"}}]"}}"#, - r#"{"uses":"infinyon/json-sql@0.1.0","invoke":"insert","with":{"mapping":"{\"table\":\"topic_message_demo\",\"map-columns\":{\"fact\":{\"json-key\":\"fact\",\"value\":{\"type\":\"text\",\"required\":true}},\"record\":{\"json-key\":\"$\",\"value\":{\"type\":\"jsonb\",\"required\":true}}}}"}}"#, + r#"{"uses":"infinyon/jolt@0.4.1","invoke":"insert","with":{"spec":"[{\"operation\":\"remove\",\"spec\":{\"length\":\"\"}}]"}}"#, + r#"{"uses":"infinyon/json-sql@0.2.1","invoke":"insert","with":{"mapping":"{\"table\":\"topic_message_demo\",\"map-columns\":{\"fact\":{\"json-key\":\"fact\",\"value\":{\"type\":\"text\",\"required\":true}},\"record\":{\"json-key\":\"$\",\"value\":{\"type\":\"jsonb\",\"required\":true}}}}"}}"#, ]; //when @@ -249,7 +248,7 @@ mod tests { //then assert_eq!(config.transforms.len(), 2); - assert_eq!(config.transforms[0].uses, "infinyon/jolt@0.1.0"); + assert_eq!(config.transforms[0].uses, "infinyon/jolt@0.4.1"); assert_eq!( config.transforms[0].with, BTreeMap::from([( @@ -258,7 +257,7 @@ mod tests { )]) ); - assert_eq!(config.transforms[1].uses, "infinyon/json-sql@0.1.0"); + assert_eq!(config.transforms[1].uses, "infinyon/json-sql@0.2.1"); assert_eq!( config.transforms[1].with, BTreeMap::from([( diff --git a/crates/fluvio-smartengine/testdata/transformation/full.yaml b/crates/fluvio-smartengine/testdata/transformation/full.yaml index 9a88c92e4c..598b6ee71c 100644 --- a/crates/fluvio-smartengine/testdata/transformation/full.yaml +++ b/crates/fluvio-smartengine/testdata/transformation/full.yaml @@ -1,5 +1,5 @@ transforms: - - uses: infinyon/jolt@0.1.0 + - uses: infinyon/jolt@0.4.1 lookback: age: 1w with: @@ -12,7 +12,7 @@ transforms: spec: device: type: "mobile" - - uses: infinyon/jolt@0.1.0 + - uses: infinyon/jolt@0.4.1 lookback: last: 1 with: @@ -25,7 +25,7 @@ transforms: spec: device: type: "mobile" - - uses: infinyon/json-sql@0.1.0 + - uses: infinyon/json-sql@0.2.1 lookback: last: 10 age: 12 s