Skip to content

Commit 922db28

Browse files
committed
change join op serialize to no_serialize
Signed-off-by: Teo Koon Peng <[email protected]>
1 parent 41a123b commit 922db28

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

diagram.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@
209209
"next": {
210210
"$ref": "#/definitions/NextOperation"
211211
},
212-
"serialize": {
213-
"description": "Whether to serialize incoming outputs before perform the join. This allows for joining outputs of different types at the cost of serialization overhead. If there is true, the resulting output will be of [`serde_json::Value`].",
212+
"no_serialize": {
213+
"description": "Do not serialize before performing the join. If true, joins can only be done on outputs of the same type.",
214214
"type": [
215215
"boolean",
216216
"null"

src/diagram/join.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ use super::{DiagramError, DynOutput, NextOperation, NodeRegistry, SerializeMessa
1414
pub struct JoinOp {
1515
pub(super) next: NextOperation,
1616

17-
/// Whether to serialize incoming outputs before perform the join. This allows for joining
18-
/// outputs of different types at the cost of serialization overhead. If there is true, the
19-
/// resulting output will be of [`serde_json::Value`].
20-
pub(super) serialize: Option<bool>,
17+
/// Do not serialize before performing the join. If true, joins can only be done
18+
/// on outputs of the same type.
19+
pub(super) no_serialize: Option<bool>,
2120
}
2221

2322
pub(super) fn register_join_impl<T, Serializer>(registry: &mut NodeRegistry)
@@ -177,6 +176,7 @@ mod tests {
177176
"join": {
178177
"type": "join",
179178
"next": "serializeJoinOutput",
179+
"no_serialize": true,
180180
},
181181
"serializeJoinOutput": {
182182
"type": "node",
@@ -242,6 +242,7 @@ mod tests {
242242
"join": {
243243
"type": "join",
244244
"next": { "builtin": "terminate" },
245+
"no_serialize": true,
245246
},
246247
}
247248
}))
@@ -296,7 +297,6 @@ mod tests {
296297
"join": {
297298
"type": "join",
298299
"next": { "builtin": "terminate" },
299-
"serialize": true,
300300
},
301301
}
302302
}))

src/diagram/workflow_builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,11 @@ fn connect_vertex<'a>(
264264
})
265265
.collect();
266266

267-
let joined_output = if join_op.serialize.unwrap_or(false) {
268-
serialize_and_join(builder, registry, outputs)?.into()
269-
} else {
267+
let joined_output = if join_op.no_serialize.unwrap_or(false) {
270268
let join_impl = &registry.join_impls[&outputs[0].type_id];
271269
join_impl(builder, outputs)?
270+
} else {
271+
serialize_and_join(builder, registry, outputs)?.into()
272272
};
273273

274274
let out_edge = edges.get_mut(&target.out_edges[0]).unwrap();

0 commit comments

Comments
 (0)