|
|
|
@ -4,13 +4,14 @@ SQLAlchemy implementation of the WorkflowNodeExecutionRepository.
|
|
|
|
|
|
|
|
|
|
|
|
import json
|
|
|
|
import json
|
|
|
|
import logging
|
|
|
|
import logging
|
|
|
|
from collections.abc import Sequence
|
|
|
|
from collections.abc import Mapping, Sequence
|
|
|
|
from typing import Optional, Union
|
|
|
|
from typing import Any, Optional, Union, cast
|
|
|
|
|
|
|
|
|
|
|
|
from sqlalchemy import UnaryExpression, asc, delete, desc, select
|
|
|
|
from sqlalchemy import UnaryExpression, asc, delete, desc, select
|
|
|
|
from sqlalchemy.engine import Engine
|
|
|
|
from sqlalchemy.engine import Engine
|
|
|
|
from sqlalchemy.orm import sessionmaker
|
|
|
|
from sqlalchemy.orm import sessionmaker
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from core.workflow.entities.node_entities import NodeRunMetadataKey
|
|
|
|
from core.workflow.entities.node_execution_entities import (
|
|
|
|
from core.workflow.entities.node_execution_entities import (
|
|
|
|
NodeExecution,
|
|
|
|
NodeExecution,
|
|
|
|
NodeExecutionStatus,
|
|
|
|
NodeExecutionStatus,
|
|
|
|
@ -122,7 +123,12 @@ class SQLAlchemyWorkflowNodeExecutionRepository(WorkflowNodeExecutionRepository)
|
|
|
|
status=status,
|
|
|
|
status=status,
|
|
|
|
error=db_model.error,
|
|
|
|
error=db_model.error,
|
|
|
|
elapsed_time=db_model.elapsed_time,
|
|
|
|
elapsed_time=db_model.elapsed_time,
|
|
|
|
metadata=metadata,
|
|
|
|
# FIXME(QuantumGhost): a temporary workaround for the following type check failure in Python 3.11.
|
|
|
|
|
|
|
|
# However, this problem is not occurred in Python 3.12.
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
# A case of this error is:
|
|
|
|
|
|
|
|
# https://github.com/langgenius/dify/actions/runs/15112698604/job/42475659482?pr=19737#step:9:24
|
|
|
|
|
|
|
|
metadata=cast(Mapping[NodeRunMetadataKey, Any] | None, metadata),
|
|
|
|
created_at=db_model.created_at,
|
|
|
|
created_at=db_model.created_at,
|
|
|
|
finished_at=db_model.finished_at,
|
|
|
|
finished_at=db_model.finished_at,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|