Skip to content

Commit

Permalink
fix(awel): Fix awel check for empty DataFrame data bug (#1430)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyhhyyyyyy authored Apr 18, 2024
1 parent 8625690 commit 00af9fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dbgpt/core/awel/operators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions dbgpt/core/awel/task/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 00af9fe

Please sign in to comment.