Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.1] Record implicitly converted dataset as input dataset #19301

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
18 changes: 18 additions & 0 deletions lib/galaxy_test/api/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2511,6 +2511,24 @@ def test_multi_param_column_nested_list_fails_on_invalid_column(self):
exception_raised = e
assert exception_raised, "Expected invalid column selection to fail job"

@skip_without_tool("implicit_conversion_format_input")
def test_implicit_conversion_input_dataset_tracking(self):
with self.dataset_populator.test_history() as history_id:
compressed_path = self.test_data_resolver.get_filename("1.fastqsanger.gz")
with open(compressed_path, "rb") as fh:
dataset = self.dataset_populator.new_dataset(
history_id, content=fh, file_type="fastqsanger.gz", wait=True
)
outputs = self._run(
"Grep1", history_id=history_id, inputs={"data": {"src": "hda", "id": dataset["id"]}}, assert_ok=True
)
job_details = self.dataset_populator.get_job_details(outputs["jobs"][0]["id"], full=True).json()
assert job_details["inputs"]["input"]["id"] != dataset["id"]
converted_input = self.dataset_populator.get_history_dataset_details(
history_id=history_id, content_id=job_details["inputs"]["input"]["id"]
)
assert converted_input["extension"] == "fastqsanger"

@skip_without_tool("column_multi_param")
def test_implicit_conversion_and_reduce(self):
with self.dataset_populator.test_history() as history_id:
Expand Down
Loading