Skip to content

Commit

Permalink
Merge branch 'main' into enhancement-result-tracking-2023-02-28
Browse files Browse the repository at this point in the history
  • Loading branch information
cicdw authored Feb 28, 2023
2 parents e845f7e + dfee140 commit db9e9f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/prefect/cli/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,8 @@ async def build(
"--description",
"-d",
help=(
"The description to give the deployment. "
"If not provided, the description will be populated from the flow's description."
"The description to give the deployment. If not provided, the description"
" will be populated from the flow's description."
),
),
version: str = typer.Option(
Expand Down Expand Up @@ -1077,6 +1077,9 @@ async def build(
if parameters:
init_kwargs["parameters"] = parameters

if description:
init_kwargs["description"] = description

# if a schedule, tags, work_queue_name, or infrastructure are not provided via CLI,
# we let `build_from_flow` load them from the server
if schedule:
Expand All @@ -1094,7 +1097,6 @@ async def build(
deployment = await Deployment.build_from_flow(
flow=flow,
name=name,
description=description,
output=deployment_loc,
skip_upload=skip_upload,
apply=False,
Expand Down
4 changes: 1 addition & 3 deletions src/prefect/deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@ async def build_from_flow(
cls,
flow: Flow,
name: str,
description: str = None,
output: str = None,
skip_upload: bool = False,
ignore_file: str = ".prefectignore",
Expand All @@ -701,7 +700,6 @@ async def build_from_flow(
Args:
flow: A flow function to deploy
name: A name for the deployment
description (optional): A description for the deployment; defaults to the flow's description
output (optional): if provided, the full deployment specification will be written as a YAML
file in the location specified by `output`
skip_upload: if True, deployment files are not automatically uploaded to remote storage
Expand All @@ -718,7 +716,7 @@ async def build_from_flow(

# note that `deployment.load` only updates settings that were *not*
# provided at initialization
deployment = cls(name=name, description=description, **kwargs)
deployment = cls(name=name, **kwargs)
deployment.flow_name = flow.name
if not deployment.entrypoint:
## first see if an entrypoint can be determined
Expand Down

0 comments on commit db9e9f1

Please sign in to comment.