mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-02 08:40:36 +00:00
fix(awel): Fix awel check for empty DataFrame data bug (#1430)
This commit is contained in:
parent
8625690107
commit
00af9fed35
@ -25,7 +25,7 @@ from dbgpt.util.executor_utils import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from ..dag.base import DAG, DAGContext, DAGNode, DAGVar
|
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)
|
F = TypeVar("F", bound=FunctionType)
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ class BaseOperator(DAGNode, ABC, Generic[OUT], metaclass=BaseOperatorMeta):
|
|||||||
Returns:
|
Returns:
|
||||||
OUT: The output of the node after execution.
|
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}
|
call_data = {"data": call_data}
|
||||||
out_ctx = await self._runner.execute_workflow(
|
out_ctx = await self._runner.execute_workflow(
|
||||||
self, call_data, exist_dag_ctx=dag_ctx
|
self, call_data, exist_dag_ctx=dag_ctx
|
||||||
|
@ -56,6 +56,8 @@ def is_empty_data(data: Any):
|
|||||||
"""Check if the data is empty."""
|
"""Check if the data is empty."""
|
||||||
if isinstance(data, _EMPTY_DATA_TYPE):
|
if isinstance(data, _EMPTY_DATA_TYPE):
|
||||||
return data in (EMPTY_DATA, SKIP_DATA)
|
return data in (EMPTY_DATA, SKIP_DATA)
|
||||||
|
elif hasattr(data, "empty"):
|
||||||
|
return getattr(data, "empty", False)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user