Merge pull request #8910 from jmchilton/no_recompute_input_ext

Do not re-compute job input_ext/dbkey in job finish.
This commit is contained in:
John Chilton
2019-11-04 08:37:25 -05:00
committed by GitHub
3 changed files with 23 additions and 9 deletions
+19 -8
View File
@@ -1695,14 +1695,25 @@ class JobWrapper(HasResourceParameters):
self.cleanup(delete_files=delete_files)
def discover_outputs(self, job, inp_data, out_data, out_collections):
input_ext = 'data'
input_dbkey = '?'
for _, data in inp_data.items():
# For loop odd, but sort simulating behavior in galaxy.tools.actions
if not data:
continue
input_ext = data.ext
input_dbkey = data.dbkey or '?'
# Try to just recover input_ext and dbkey from job parameters (used and set in
# galaxy.tools.actions). Old jobs may have not set these in the job parameters
# before persisting them.
input_params = job.raw_param_dict()
input_ext = input_params.get("__input_ext")
input_dbkey = input_params.get("dbkey")
if input_ext is not None:
input_ext = loads(input_ext)
input_dbkey = loads(input_dbkey)
else:
# Legacy jobs without __input_ext.
input_ext = 'data'
input_dbkey = '?'
for _, data in inp_data.items():
# For loop odd, but sort simulating behavior in galaxy.tools.actions
if not data:
continue
input_ext = data.ext
input_dbkey = data.dbkey or '?'
# Create generated output children and primary datasets.
tool_working_directory = self.tool_working_directory
+3 -1
View File
@@ -283,7 +283,9 @@ class JobSearch(object):
# parameter as these are not passed along when expanding tool parameters
# and they can differ without affecting the resulting dataset.
for parameter in job.parameters:
if parameter.name in {'__workflow_invocation_uuid__', 'chromInfo', 'dbkey'} or parameter.name.endswith('|__identifier__'):
if parameter.name.startswith("__"):
continue
if parameter.name in {'chromInfo', 'dbkey'} or parameter.name.endswith('|__identifier__'):
continue
n_parameters += 1
if not n_parameters == len(param_dump):
+1
View File
@@ -334,6 +334,7 @@ class DefaultToolAction(object):
# Add the dbkey to the incoming parameters
incoming["dbkey"] = input_dbkey
incoming["__input_ext"] = input_ext
# wrapped params are used by change_format action and by output.label; only perform this wrapping once, as needed
wrapped_params = self._wrapped_params(trans, tool, incoming, inp_data)