Skip to content

Commit

Permalink
Make udfs field optional in REST API
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeisen committed Aug 15, 2023
1 parent 2cb5ac2 commit 0de2ce3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions arroyo-api/src/pipelines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ pub async fn validate_pipeline(
parallelism: 1,
udfs: validate_pipeline_post
.udfs
.unwrap_or(vec![])
.into_iter()
.map(|u| CreateUdf {
language: 0,
Expand Down Expand Up @@ -389,6 +390,7 @@ pub async fn post_pipeline(
parallelism: pipeline_post.parallelism,
udfs: pipeline_post
.udfs
.unwrap_or(vec![])
.into_iter()
.map(|u| CreateUdf {
language: 0,
Expand Down
4 changes: 2 additions & 2 deletions arroyo-rpc/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ use utoipa::ToSchema;
#[serde(rename_all = "camelCase")]
pub struct ValidatePipelinePost {
pub query: String,
pub udfs: Vec<Udf>,
pub udfs: Option<Vec<Udf>>,
}

#[derive(Serialize, Deserialize, Clone, Debug, ToSchema)]
#[serde(rename_all = "camelCase")]
pub struct PipelinePost {
pub name: String,
pub query: String,
pub udfs: Vec<Udf>,
pub udfs: Option<Vec<Udf>>,
pub preview: Option<bool>,
pub parallelism: u64,
}
Expand Down
2 changes: 1 addition & 1 deletion integ/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ pub async fn main() {
by hop(interval '2 seconds', interval '10 seconds')",
source_name
),
udfs: vec![],
udfs: None,
},
)
.await
Expand Down

0 comments on commit 0de2ce3

Please sign in to comment.