Skip to content

Commit

Permalink
fix isinstance check
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz committed Dec 11, 2024
1 parent 859ee27 commit 56b828d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/prefect/_internal/compatibility/async_dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ def is_in_async_context() -> bool:


def _is_acceptable_callable(obj: Union[Callable[P, R], "Task[P, R]"]) -> bool:
from prefect.tasks import Task

if inspect.iscoroutinefunction(obj):
return True
if isinstance(obj, "Task") and inspect.iscoroutinefunction(obj.fn):
if isinstance(obj, Task) and inspect.iscoroutinefunction(obj.fn):
return True
return False

Expand Down

0 comments on commit 56b828d

Please sign in to comment.