diff --git a/wren-core-py/src/errors.rs b/wren-core-py/src/errors.rs index 44f1fa2b9..2c2adb13a 100644 --- a/wren-core-py/src/errors.rs +++ b/wren-core-py/src/errors.rs @@ -26,30 +26,30 @@ impl From for PyErr { impl From for CoreError { fn from(err: PyErr) -> Self { - CoreError::new(&err.to_string()) + CoreError::new(&format!("PyError: {}", &err)) } } impl From for CoreError { fn from(err: DecodeError) -> Self { - CoreError::new(&err.to_string()) + CoreError::new(&format!("Base64 decode error: {}", err)) } } impl From for CoreError { fn from(err: FromUtf8Error) -> Self { - CoreError::new(&err.to_string()) + CoreError::new(&format!("FromUtf8Error: {}", err)) } } impl From for CoreError { fn from(err: serde_json::Error) -> Self { - CoreError::new(&err.to_string()) + CoreError::new(&format!("Serde JSON error: {}", err)) } } impl From for CoreError { fn from(err: wren_core::DataFusionError) -> Self { - CoreError::new(&err.to_string()) + CoreError::new(&format!("DataFusion error: {}", err)) } } diff --git a/wren-core/core/src/mdl/builder.rs b/wren-core/core/src/mdl/builder.rs index 2b4058f67..977b52eda 100644 --- a/wren-core/core/src/mdl/builder.rs +++ b/wren-core/core/src/mdl/builder.rs @@ -82,7 +82,6 @@ impl ModelBuilder { primary_key: None, cached: false, refresh_time: None, - properties: BTreeMap::default(), }, } } @@ -122,13 +121,6 @@ impl ModelBuilder { self } - pub fn property(mut self, key: &str, value: &str) -> Self { - self.model - .properties - .insert(key.to_string(), value.to_string()); - self - } - pub fn build(self) -> Arc { Arc::new(self.model) } @@ -148,7 +140,6 @@ impl ColumnBuilder { is_calculated: false, not_null: false, expression: None, - properties: BTreeMap::default(), }, } } @@ -181,13 +172,6 @@ impl ColumnBuilder { self } - pub fn property(mut self, key: &str, value: &str) -> Self { - self.column - .properties - .insert(key.to_string(), value.to_string()); - self - } - pub fn build(self) -> Arc { Arc::new(self.column) } @@ -205,7 +189,6 @@ impl RelationshipBuilder { models: vec![], join_type: JoinType::OneToOne, condition: "".to_string(), - properties: BTreeMap::default(), }, } } @@ -225,13 +208,6 @@ impl RelationshipBuilder { self } - pub fn property(mut self, key: &str, value: &str) -> Self { - self.relationship - .properties - .insert(key.to_string(), value.to_string()); - self - } - pub fn build(self) -> Arc { Arc::new(self.relationship) } @@ -252,7 +228,6 @@ impl MetricBuilder { time_grain: vec![], cached: false, refresh_time: None, - properties: BTreeMap::default(), }, } } @@ -282,13 +257,6 @@ impl MetricBuilder { self } - pub fn property(mut self, key: &str, value: &str) -> Self { - self.metric - .properties - .insert(key.to_string(), value.to_string()); - self - } - pub fn build(self) -> Arc { Arc::new(self.metric) } @@ -334,7 +302,6 @@ impl ViewBuilder { view: View { name: name.to_string(), statement: "".to_string(), - properties: BTreeMap::default(), }, } } @@ -344,13 +311,6 @@ impl ViewBuilder { self } - pub fn property(mut self, key: &str, value: &str) -> Self { - self.view - .properties - .insert(key.to_string(), value.to_string()); - self - } - pub fn build(self) -> Arc { Arc::new(self.view) } @@ -374,7 +334,6 @@ mod test { .calculated(true) .not_null(true) .expression("test") - .property("key", "value") .build(); let json_str = serde_json::to_string(&expected).unwrap(); @@ -430,7 +389,6 @@ mod test { .primary_key("id") .cached(true) .refresh_time("1h") - .property("key", "value") .build(); let json_str = serde_json::to_string(&model).unwrap(); @@ -445,7 +403,6 @@ mod test { .primary_key("id") .cached(true) .refresh_time("1h") - .property("key", "value") .build(); let json_str = serde_json::to_string(&model).unwrap(); @@ -470,7 +427,6 @@ mod test { .model("testB") .join_type(JoinType::OneToMany) .condition("test") - .property("key", "value") .build(); let json_str = serde_json::to_string(&expected).unwrap(); @@ -523,7 +479,6 @@ mod test { ) .cached(true) .refresh_time("1h") - .property("key", "value") .build(); let json_str = serde_json::to_string(&model).unwrap(); @@ -535,7 +490,6 @@ mod test { fn test_view_roundtrip() { let expected = ViewBuilder::new("test") .statement("SELECT * FROM test") - .property("key", "value") .build(); let json_str = serde_json::to_string(&expected).unwrap(); @@ -553,7 +507,6 @@ mod test { .primary_key("id") .cached(true) .refresh_time("1h") - .property("key", "value") .build(); let relationship = RelationshipBuilder::new("test") @@ -561,7 +514,6 @@ mod test { .model("testB") .join_type(JoinType::OneToMany) .condition("test") - .property("key", "value") .build(); let metric = MetricBuilder::new("test") @@ -575,12 +527,10 @@ mod test { ) .cached(true) .refresh_time("1h") - .property("key", "value") .build(); let view = ViewBuilder::new("test") .statement("SELECT * FROM test") - .property("key", "value") .build(); let expected = crate::mdl::builder::ManifestBuilder::new() diff --git a/wren-core/core/src/mdl/manifest.rs b/wren-core/core/src/mdl/manifest.rs index 0cc184beb..98ec42e54 100644 --- a/wren-core/core/src/mdl/manifest.rs +++ b/wren-core/core/src/mdl/manifest.rs @@ -1,4 +1,3 @@ -use std::collections::BTreeMap; use std::fmt::Display; use std::sync::Arc; @@ -39,8 +38,6 @@ pub struct Model { pub cached: bool, #[serde(default)] pub refresh_time: Option, - #[serde(default)] - pub properties: BTreeMap, } impl Model { @@ -170,8 +167,6 @@ pub struct Column { #[serde_as(as = "NoneAsEmptyString")] #[serde(default)] pub expression: Option, - #[serde(default)] - pub properties: BTreeMap, } #[derive(Serialize, Deserialize, Debug, Hash, PartialEq, Eq)] @@ -181,8 +176,6 @@ pub struct Relationship { pub models: Vec, pub join_type: JoinType, pub condition: String, - #[serde(default)] - pub properties: BTreeMap, } #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Hash, Clone, Copy)] @@ -226,7 +219,6 @@ pub struct Metric { #[serde(default, with = "bool_from_int")] pub cached: bool, pub refresh_time: Option, - pub properties: BTreeMap, } impl Metric { @@ -257,8 +249,6 @@ pub enum TimeUnit { pub struct View { pub name: String, pub statement: String, - #[serde(default)] - pub properties: BTreeMap, } impl View {