Skip to content

Commit

Permalink
Fix target_type in auto-conversion context
Browse files Browse the repository at this point in the history
which means we collect and store the converted dataset as the job input.

We don't need to wait for the galaxy.json collection, we know the exact
target type already. That fixes the retrieval in
`get_converted_files_by_type`.

I believe this was always the intention and is how it works if the
dataset already exists (i.e. on a re-run), and for all converters that
don't use galaxy.json The converter records the dataset that the user
chose, so there's no gap in the provenance either.

This somewhat addresses
galaxyproject/total-perspective-vortex#141
so you can (reliably) differetiate your rules on the input datatype
and filesize combination.
  • Loading branch information
mvdbeek committed Dec 11, 2024
1 parent 616fe39 commit 91660b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/galaxy/datatypes/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,11 @@ def convert_dataset(
job, converted_datasets, *_ = converter.execute(
trans, incoming=params, set_output_hid=visible, history=history, flush_job=False
)
# We should only have a single converted output, but let's be defensive here
n_converted_datasets = len(converted_datasets)
for converted_dataset in converted_datasets.values():
if converted_dataset.extension == "auto" and n_converted_datasets == 1:
converted_dataset.extension = target_type
original_dataset.attach_implicitly_converted_dataset(trans.sa_session, converted_dataset, target_type)
trans.app.job_manager.enqueue(job, tool=converter)
if len(params) > 0:
Expand Down

0 comments on commit 91660b9

Please sign in to comment.