Skip to content

Commit 88cad9b

Browse files
committed
add some comments
1 parent 1df0183 commit 88cad9b

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

packages/cubejs-backend-native/src/node_obj_deserializer.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,7 @@ impl<'de, 'a, 'b> Deserializer<'de> for JsValueDeserializer<'a, 'b> {
132132
visitor.visit_none()
133133
} else if self.value.is_a::<JsFunction, _>(self.cx) {
134134
// We can do nothing with the JS functions in native
135-
// so let's save them as string for potential usage later
136-
// in JS side if needed
137-
let value = self
138-
.value
139-
.downcast::<JsFunction, _>(self.cx)
140-
.or_throw(self.cx)?
141-
.to_string(self.cx)?
142-
.value(self.cx);
143-
visitor.visit_string(value)
135+
visitor.visit_none()
144136
} else {
145137
Err(JsDeserializationError(
146138
"Unsupported type for deserialization".to_string(),

rust/cubeorchestrator/src/transport.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,15 @@ pub struct GroupingSet {
8282
pub sub_id: Option<u32>,
8383
}
8484

85+
// We can do nothing with JS functions here,
86+
// but to keep DTOs in sync with reality, let's keep it.
87+
type JsFunction = String;
88+
8589
#[derive(Debug, Clone, Serialize, Deserialize, Hash, Eq, PartialEq)]
8690
#[serde(rename_all = "camelCase")]
8791
pub struct MemberExpression {
88-
#[serde(skip_deserializing)]
89-
pub expression: Option<Value>,
92+
// Made as Option and JsValueDeserializer set's it to None.
93+
pub expression: Option<JsFunction>,
9094
pub cube_name: String,
9195
pub name: String,
9296
#[serde(skip_serializing_if = "Option::is_none")]

0 commit comments

Comments
 (0)