mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-04 10:34:30 +00:00
Native data AI application framework based on AWEL+AGENT (#1152)
Co-authored-by: Fangyin Cheng <staneyffer@gmail.com> Co-authored-by: lcx01800250 <lcx01800250@alibaba-inc.com> Co-authored-by: licunxing <864255598@qq.com> Co-authored-by: Aralhi <xiaoping0501@gmail.com> Co-authored-by: xuyuan23 <643854343@qq.com> Co-authored-by: aries_ckt <916701291@qq.com> Co-authored-by: hzh97 <2976151305@qq.com>
This commit is contained in:
@@ -14,6 +14,7 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Union, ca
|
||||
|
||||
from dbgpt.component import SystemApp
|
||||
|
||||
from ..flow.base import ViewMixin
|
||||
from ..resource.base import ResourceGroup
|
||||
from ..task.base import TaskContext, TaskOutput
|
||||
|
||||
@@ -235,7 +236,7 @@ class DAGLifecycle:
|
||||
pass
|
||||
|
||||
|
||||
class DAGNode(DAGLifecycle, DependencyMixin, ABC):
|
||||
class DAGNode(DAGLifecycle, DependencyMixin, ViewMixin, ABC):
|
||||
"""The base class of DAGNode."""
|
||||
|
||||
resource_group: Optional[ResourceGroup] = None
|
||||
@@ -703,6 +704,22 @@ class DAG:
|
||||
"""Exit a DAG context."""
|
||||
DAGVar.exit_dag()
|
||||
|
||||
def __hash__(self) -> int:
|
||||
"""Return the hash value of current DAG.
|
||||
|
||||
If the dag_id is not None, return the hash value of dag_id.
|
||||
"""
|
||||
if self.dag_id:
|
||||
return hash(self.dag_id)
|
||||
else:
|
||||
return super().__hash__()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Return whether the current DAG is equal to other DAG."""
|
||||
if not isinstance(other, DAG):
|
||||
return False
|
||||
return self.dag_id == other.dag_id
|
||||
|
||||
def __repr__(self):
|
||||
"""Return the representation of current DAG."""
|
||||
return f"DAG(dag_id={self.dag_id})"
|
||||
|
Reference in New Issue
Block a user