Skip to content

Commit

Permalink
Reraise if safe loading the flow fails
Browse files Browse the repository at this point in the history
  • Loading branch information
desertaxle committed Jul 23, 2024
1 parent a3d3d81 commit 83327a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/prefect/cli/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ async def _run_single_deploy(
deploy_config["entrypoint"] = await prompt_entrypoint(app.console)

flow = load_flow_from_entrypoint(deploy_config["entrypoint"])
assert flow is not None, "Flow could not be loaded from entrypoint."

deploy_config["flow_name"] = flow.name

Expand Down
2 changes: 2 additions & 0 deletions src/prefect/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -1739,6 +1739,8 @@ def load_flow_from_entrypoint(
# environment, fallback to loading the flow via AST parsing.
if use_placeholder_flow:
flow = safe_load_flow_from_entrypoint(entrypoint)
if flow is None:
raise
else:
raise

Expand Down

0 comments on commit 83327a3

Please sign in to comment.