From c83af5f2c384c2de723ae2ecd046789bdf567647 Mon Sep 17 00:00:00 2001 From: kacey Date: Tue, 12 Sep 2023 10:05:03 -0700 Subject: [PATCH] make async check more general --- fiftyone/operators/executor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fiftyone/operators/executor.py b/fiftyone/operators/executor.py index 1d0deb0c61..251e05987c 100644 --- a/fiftyone/operators/executor.py +++ b/fiftyone/operators/executor.py @@ -6,6 +6,7 @@ | """ import asyncio +import inspect import traceback import types as python_types @@ -199,7 +200,7 @@ async def execute_or_delegate_operator(operator_uri, request_params): try: raw_result = await ( operator.execute(ctx) - if asyncio.iscoroutinefunction(operator.execute) + if inspect.isawaitable(operator.execute) else fou.run_sync_task(operator.execute, ctx) )