diff --git a/dbgpt/core/awel/operators/base.py b/dbgpt/core/awel/operators/base.py index f9ba12169..286979662 100644 --- a/dbgpt/core/awel/operators/base.py +++ b/dbgpt/core/awel/operators/base.py @@ -25,7 +25,7 @@ ) from ..dag.base import DAG, DAGContext, DAGNode, DAGVar -from ..task.base import EMPTY_DATA, OUT, T, TaskOutput +from ..task.base import EMPTY_DATA, OUT, T, TaskOutput, is_empty_data F = TypeVar("F", bound=FunctionType) @@ -213,7 +213,7 @@ async def call( Returns: OUT: The output of the node after execution. """ - if call_data != EMPTY_DATA: + if not is_empty_data(call_data): call_data = {"data": call_data} out_ctx = await self._runner.execute_workflow( self, call_data, exist_dag_ctx=dag_ctx diff --git a/dbgpt/core/awel/task/base.py b/dbgpt/core/awel/task/base.py index a5cbc6e0b..abadfcaf0 100644 --- a/dbgpt/core/awel/task/base.py +++ b/dbgpt/core/awel/task/base.py @@ -56,6 +56,8 @@ def is_empty_data(data: Any): """Check if the data is empty.""" if isinstance(data, _EMPTY_DATA_TYPE): return data in (EMPTY_DATA, SKIP_DATA) + elif hasattr(data, "empty"): + return getattr(data, "empty", False) return False