Skip to content

Commit

Permalink
Merge pull request #1892 from josenavas/tijuaflow
Browse files Browse the repository at this point in the history
Fixing workflow bug
  • Loading branch information
antgonza committed Jul 10, 2016
2 parents 5977e9e + 5b8aaf8 commit 9f32be2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion qiita_db/processing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,12 +582,18 @@ def _update_children(self, mapping):
SET command_parameters = %s,
pending = %s
WHERE processing_job_id = %s"""
sql_link = """INSERT INTO qiita.artifact_processing_job
(artifact_id, processing_job_id)
VALUES (%s, %s)"""
for c in self.children:
qdb.sql_connection.TRN.add(sql, [c.id])
params, pending = qdb.sql_connection.TRN.execute_fetchflatten()
for pname, out_name in viewitems(pending[self.id]):
params[pname] = new_map[out_name]
a_id = new_map[out_name]
params[pname] = a_id
del pending[self.id]
# Link the input artifact with the child job
qdb.sql_connection.TRN.add(sql_link, [a_id, c.id])

# Force to insert a NULL in the DB if pending is empty
pending = pending if pending else None
Expand Down
1 change: 1 addition & 0 deletions qiita_db/test/test_processing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ def test_update_children(self):
obs = parent._update_children(mapping)
exp = [child]
self.assertTrue(obs, exp)
self.assertEqual(child.input_artifacts, [qdb.artifact.Artifact(3)])


class ProcessingWorkflowTestsReadOnly(TestCase):
Expand Down

0 comments on commit 9f32be2

Please sign in to comment.