Skip to content

Commit

Permalink
Fix bug where sync compatible does not work when loading flow for exe…
Browse files Browse the repository at this point in the history
…cution
  • Loading branch information
zanieb committed Jun 29, 2022
1 parent 78d62b3 commit bddc8f1
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 bddc8f1

Please sign in to comment.