Skip to content

Commit a0bf688

Browse files
committed
fix: align derived DAG validation with current schema versions
1 parent c2ac090 commit a0bf688

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎crates/asap_types/src/derived_input.rs‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ impl DerivedInputIdentity {
3737
root: PostAsapNodeId,
3838
frontiers: &BTreeMap<PostAsapNodeId, SummaryDefinitionId>,
3939
) -> Result<Self, String> {
40-
if !matches!(
41-
document.schema_version,
42-
crate::executable_plan::OWNED_POST_ASAP_DAG_SCHEMA_VERSION
43-
| crate::executable_plan::MAINTENANCE_DAG_SCHEMA_VERSION
44-
) {
40+
if ![
41+
crate::executable_plan::OWNED_POST_ASAP_DAG_SCHEMA_VERSION,
42+
crate::executable_plan::MAINTENANCE_DAG_SCHEMA_VERSION,
43+
]
44+
.contains(&document.schema_version)
45+
{
4546
return Err("unsupported derived program document version".into());
4647
}
4748
let decoded = document.decode()?;
@@ -216,7 +217,7 @@ mod tests {
216217
};
217218
let state = ExecutionDataState::MAINTENANCE_SUMMARY;
218219
OwnedPostAsapDag {
219-
schema_version: 1,
220+
schema_version: crate::executable_plan::OWNED_POST_ASAP_DAG_SCHEMA_VERSION,
220221
query_id: "query-a".into(),
221222
root: PostAsapNodeId(root),
222223
nodes: [source, root]

0 commit comments

Comments
 (0)