Skip to content

Commit

Permalink
Merge branch 'flow2.0-operators' into chore/update-api
Browse files Browse the repository at this point in the history
  • Loading branch information
谨欣 committed Aug 30, 2024
2 parents dbd1a4a + 08b0c78 commit 3e0a243
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions dbgpt/core/awel/flow/flow_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,11 @@ def build(self, flow_panel: FlowPanel) -> DAG:
key_to_resource_nodes[key] = node
key_to_resource[key] = node.data

if not key_to_operator_nodes and not key_to_resource_nodes:
raise FlowMetadataException(
"No operator or resource nodes found in the flow."
)

for edge_index, edge in enumerate(flow_data.edges):
source_key = edge.source
target_key = edge.target
Expand Down
5 changes: 4 additions & 1 deletion dbgpt/serve/flow/api/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ async def update(
ServerResponse: The response
"""
try:
return Result.succ(service.update_flow(request))
res = await blocking_func_to_async(
global_system_app, service.update_flow, request
)
return Result.succ(res)
except Exception as e:
return Result.failed(msg=str(e))

Expand Down

0 comments on commit 3e0a243

Please sign in to comment.