Skip to content

Commit

Permalink
Fix bug where a flow's parameter schema is not included in deployment…
Browse files Browse the repository at this point in the history
… create/update requests when using `prefect deploy` (#17079)
  • Loading branch information
desertaxle authored Feb 10, 2025
1 parent 4aca322 commit f8b15df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/prefect/cli/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,13 +774,14 @@ async def _run_single_deploy(
tags=deploy_config.get("tags"),
concurrency_limit=deploy_config.get("concurrency_limit"),
concurrency_options=deploy_config.get("concurrency_options"),
parameter_openapi_schema=deploy_config.get("parameter_openapi_schema"),
schedules=deploy_config.get("schedules"),
paused=deploy_config.get("paused"),
storage=_PullStepStorage(pull_steps),
job_variables=get_from_dict(deploy_config, "work_pool.job_variables"),
)

deployment._parameter_openapi_schema = deploy_config["parameter_openapi_schema"]

if deploy_config.get("enforce_parameter_schema") is not None:
deployment.enforce_parameter_schema = deploy_config.get(
"enforce_parameter_schema"
Expand Down
3 changes: 3 additions & 0 deletions tests/cli/test_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2363,6 +2363,8 @@ async def test_deploy_update_does_not_override_enforce_parameter_schema(
"An important name/test-name"
)
assert not deployment.enforce_parameter_schema
assert deployment.parameter_openapi_schema
parameter_openapi_schema = deployment.parameter_openapi_schema

prefect_yaml_file = Path("prefect.yaml")
with prefect_yaml_file.open(mode="r") as f:
Expand Down Expand Up @@ -2390,6 +2392,7 @@ async def test_deploy_update_does_not_override_enforce_parameter_schema(
"An important name/test-name"
)
assert not deployment.enforce_parameter_schema
assert deployment.parameter_openapi_schema == parameter_openapi_schema


class TestSchedules:
Expand Down

0 comments on commit f8b15df

Please # to comment.