Skip to content

Commit

Permalink
add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
KSDaemon committed Dec 18, 2024
1 parent 1df0183 commit 88cad9b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
10 changes: 1 addition & 9 deletions packages/cubejs-backend-native/src/node_obj_deserializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,7 @@ impl<'de, 'a, 'b> Deserializer<'de> for JsValueDeserializer<'a, 'b> {
visitor.visit_none()
} else if self.value.is_a::<JsFunction, _>(self.cx) {
// We can do nothing with the JS functions in native
// so let's save them as string for potential usage later
// in JS side if needed
let value = self
.value
.downcast::<JsFunction, _>(self.cx)
.or_throw(self.cx)?
.to_string(self.cx)?
.value(self.cx);
visitor.visit_string(value)
visitor.visit_none()
} else {
Err(JsDeserializationError(
"Unsupported type for deserialization".to_string(),
Expand Down
8 changes: 6 additions & 2 deletions rust/cubeorchestrator/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,15 @@ pub struct GroupingSet {
pub sub_id: Option<u32>,
}

// We can do nothing with JS functions here,
// but to keep DTOs in sync with reality, let's keep it.
type JsFunction = String;

#[derive(Debug, Clone, Serialize, Deserialize, Hash, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct MemberExpression {
#[serde(skip_deserializing)]
pub expression: Option<Value>,
// Made as Option and JsValueDeserializer set's it to None.
pub expression: Option<JsFunction>,
pub cube_name: String,
pub name: String,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down

0 comments on commit 88cad9b

Please sign in to comment.