Skip to content

Commit 00a1fae

Browse files
committed
fix workflow GUI
1 parent 8612459 commit 00a1fae

File tree

1 file changed

+28
-17
lines changed

1 file changed

+28
-17
lines changed

qiita_db/artifact.py

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,23 +1342,6 @@ def _helper(sql_edges, edges, nodes):
13421342
# If the job is in success we don't need to do anything
13431343
# else since it would've been added by the code above
13441344
if jstatus != 'success':
1345-
# Connect the job with his input artifacts, the
1346-
# input artifacts may or may not exist yet, so we
1347-
# need to check both the input_artifacts and the
1348-
# pending properties
1349-
for in_art in n_obj.input_artifacts:
1350-
iid = in_art.id
1351-
if iid not in nodes and iid in extra_nodes:
1352-
nodes[iid] = extra_nodes[iid]
1353-
_add_edge(edges, nodes[iid], nodes[n_obj.id])
1354-
1355-
pending = n_obj.pending
1356-
for pred_id in pending:
1357-
for pname in pending[pred_id]:
1358-
in_node_id = '%s:%s' % (
1359-
pred_id, pending[pred_id][pname])
1360-
_add_edge(edges, nodes[in_node_id],
1361-
nodes[n_obj.id])
13621345

13631346
if jstatus != 'error':
13641347
# If the job is not errored, we can add the
@@ -1380,6 +1363,34 @@ def _helper(sql_edges, edges, nodes):
13801363
queue.append(cjob.id)
13811364
if cjob.id not in nodes:
13821365
nodes[cjob.id] = ('job', cjob)
1366+
1367+
# including the outputs
1368+
for o_name, o_type in cjob.command.outputs:
1369+
node_id = '%s:%s' % (cjob.id, o_name)
1370+
node = TypeNode(
1371+
id=node_id, job_id=cjob.id,
1372+
name=o_name, type=o_type)
1373+
if node_id not in nodes:
1374+
nodes[node_id] = ('type', node)
1375+
1376+
# Connect the job with his input artifacts, the
1377+
# input artifacts may or may not exist yet, so we
1378+
# need to check both the input_artifacts and the
1379+
# pending properties
1380+
for in_art in n_obj.input_artifacts:
1381+
iid = in_art.id
1382+
if iid not in nodes and iid in extra_nodes:
1383+
nodes[iid] = extra_nodes[iid]
1384+
_add_edge(edges, nodes[iid], nodes[n_obj.id])
1385+
1386+
pending = n_obj.pending
1387+
for pred_id in pending:
1388+
for pname in pending[pred_id]:
1389+
in_node_id = '%s:%s' % (
1390+
pred_id, pending[pred_id][pname])
1391+
_add_edge(edges, nodes[in_node_id],
1392+
nodes[n_obj.id])
1393+
13831394
elif n_type == 'type':
13841395
# Connect this 'future artifact' with the job that will
13851396
# generate it

0 commit comments

Comments
 (0)