From 7eb853d7039ee555ce2b567d94d4095b211c957d Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 31 Mar 2021 20:49:38 +0200 Subject: [PATCH] Fix format="input" with implicit conversions where the implicit converter uses galaxy.json. Add test, fix fix --- lib/galaxy/tools/actions/__init__.py | 7 ++++++ .../implicit_conversion_format_input.xml | 22 +++++++++++++++++++ test/functional/tools/samples_tool_conf.xml | 1 + 3 files changed, 30 insertions(+) create mode 100644 test/functional/tools/implicit_conversion_format_input.xml diff --git a/lib/galaxy/tools/actions/__init__.py b/lib/galaxy/tools/actions/__init__.py index 1f999877b4a..6e252224ed0 100644 --- a/lib/galaxy/tools/actions/__init__.py +++ b/lib/galaxy/tools/actions/__init__.py @@ -975,6 +975,13 @@ def determine_output_format(output, parameter_context, input_datasets, input_dat # the type should match the input ext = output.format if ext == "input": + if input_datasets and random_input_ext in {'data', 'auto'}: + # Probably dealing with an implicitly converted dataset + try: + first_input_dataset = next(iter(input_datasets.values())) + random_input_ext = get_ext_or_implicit_ext(first_input_dataset) + except Exception: + pass ext = random_input_ext format_source = output.format_source if format_source is not None and format_source in input_datasets: diff --git a/test/functional/tools/implicit_conversion_format_input.xml b/test/functional/tools/implicit_conversion_format_input.xml new file mode 100644 index 00000000000..e93f5409559 --- /dev/null +++ b/test/functional/tools/implicit_conversion_format_input.xml @@ -0,0 +1,22 @@ + + + cut -f 1 '$input1' > '$output1' + + + + + + + + + + + + + + + + + + + diff --git a/test/functional/tools/samples_tool_conf.xml b/test/functional/tools/samples_tool_conf.xml index f26fa8d68d1..47368b97a8e 100644 --- a/test/functional/tools/samples_tool_conf.xml +++ b/test/functional/tools/samples_tool_conf.xml @@ -133,6 +133,7 @@ +