Skip to content

Commit

Permalink
Merge pull request PrefectHQ/orion#2184 from PrefectHQ/fix-flow-load
Browse files Browse the repository at this point in the history
Fix bug where sync compatible does not work when loading flow for execution
  • Loading branch information
zanieb committed Jun 29, 2022
2 parents 6e5cb17 + bddc8f1 commit 7cf42cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/prefect/deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
from prefect.orion.schemas.data import DataDocument
from prefect.packaging.base import PackageManifest, Packager
from prefect.packaging.orion import OrionPackager
from prefect.utilities.asyncio import sync_compatible
from prefect.utilities.asyncio import run_sync_in_worker_thread, sync_compatible
from prefect.utilities.collections import listrepr


Expand Down Expand Up @@ -227,7 +227,9 @@ async def load_flow_from_deployment(

maybe_flow = await client.resolve_datadoc(deployment.flow_data)
if isinstance(maybe_flow, (str, bytes)):
flow = load_flow_from_text(maybe_flow, flow_model.name)
flow = await run_sync_in_worker_thread(
load_flow_from_text, maybe_flow, flow_model.name
)
elif isinstance(maybe_flow, PackageManifest):
flow = await maybe_flow.unpackage()
else:
Expand Down

0 comments on commit 7cf42cb

Please sign in to comment.