Skip to content

Commit

Permalink
fix workflow GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
antgonza committed Aug 14, 2024
1 parent 8612459 commit 00a1fae
Showing 1 changed file with 28 additions and 17 deletions.
45 changes: 28 additions & 17 deletions qiita_db/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -1342,23 +1342,6 @@ def _helper(sql_edges, edges, nodes):
# If the job is in success we don't need to do anything
# else since it would've been added by the code above
if jstatus != 'success':
# Connect the job with his input artifacts, the
# input artifacts may or may not exist yet, so we
# need to check both the input_artifacts and the
# pending properties
for in_art in n_obj.input_artifacts:
iid = in_art.id
if iid not in nodes and iid in extra_nodes:
nodes[iid] = extra_nodes[iid]
_add_edge(edges, nodes[iid], nodes[n_obj.id])

pending = n_obj.pending
for pred_id in pending:
for pname in pending[pred_id]:
in_node_id = '%s:%s' % (
pred_id, pending[pred_id][pname])
_add_edge(edges, nodes[in_node_id],
nodes[n_obj.id])

if jstatus != 'error':
# If the job is not errored, we can add the
Expand All @@ -1380,6 +1363,34 @@ def _helper(sql_edges, edges, nodes):
queue.append(cjob.id)
if cjob.id not in nodes:
nodes[cjob.id] = ('job', cjob)

# including the outputs
for o_name, o_type in cjob.command.outputs:
node_id = '%s:%s' % (cjob.id, o_name)
node = TypeNode(
id=node_id, job_id=cjob.id,
name=o_name, type=o_type)
if node_id not in nodes:
nodes[node_id] = ('type', node)

# Connect the job with his input artifacts, the
# input artifacts may or may not exist yet, so we
# need to check both the input_artifacts and the
# pending properties
for in_art in n_obj.input_artifacts:
iid = in_art.id
if iid not in nodes and iid in extra_nodes:
nodes[iid] = extra_nodes[iid]
_add_edge(edges, nodes[iid], nodes[n_obj.id])

pending = n_obj.pending
for pred_id in pending:
for pname in pending[pred_id]:
in_node_id = '%s:%s' % (
pred_id, pending[pred_id][pname])
_add_edge(edges, nodes[in_node_id],
nodes[n_obj.id])

elif n_type == 'type':
# Connect this 'future artifact' with the job that will
# generate it
Expand Down

0 comments on commit 00a1fae

Please sign in to comment.