Skip to content

Commit

Permalink
sourceCapture: error when setting targetSchema without x-schema-name
Browse files Browse the repository at this point in the history
  • Loading branch information
mdibaiee committed Sep 25, 2024
1 parent cee8ef4 commit 9b298a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/agent/src/controllers/materialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl MaterializationStatus {
dependencies.live.captures.get_by_key(&source_capture.capture_name())
{
if self.source_capture.is_none() {
self.source_capture = Some(SourceCaptureStatus::default())
self.source_capture = Some(SourceCaptureStatus::default());
}
let source_capture_status = self.source_capture.as_mut().unwrap();
// Source capture errors are terminal
Expand Down
8 changes: 8 additions & 0 deletions crates/agent/src/resource_configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ pub fn update_materialization_resource_spec(
"cannot create location '{x_schema_name_ptr}' in resource spec '{resource_spec}'"
);
}
} else {
anyhow::bail!(
"sourceCapture.targetSchema set on a materialization which does not have x-schema-name annotation"
);
}
}

Expand All @@ -56,6 +60,10 @@ pub fn update_materialization_resource_spec(
"cannot create location '{x_delta_updates_ptr}' in resource spec '{resource_spec}'"
);
}
} else {
anyhow::bail!(
"sourceCapture.deltaUpdates set on a materialization which does not have x-delta-updates annotation"
);
}
}

Expand Down

0 comments on commit 9b298a3

Please sign in to comment.