Skip to content

Commit

Permalink
flowctl: use collection readSchema in suggest-schema
Browse files Browse the repository at this point in the history
Fixes a bug in `raw suggest-schema`, where it would panic if the collection
used a `readSchema` instead of just plain `schema`.
  • Loading branch information
psFried committed Jul 25, 2023
1 parent 689e7f6 commit e02c396
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/flowctl/src/raw/suggest_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ pub async fn do_suggest_schema(
};

// The original collection schema to be used as the starting point of schema-inference
let schema_model = collection_def.schema.unwrap();
let schema_model = collection_def
.schema
.as_ref()
.or(collection_def.read_schema.as_ref())
.expect("collection must define either schema or readSchema");
// The inferred shape, we start by using the existing schema of the collection
let mut inferred_shape = raw_schema_to_shape(&schema_model)?;

Expand Down

0 comments on commit e02c396

Please sign in to comment.