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

[23.1] Shorten job_to_output_dataset_assocation.name for discovered outputs #17147

Open
wants to merge 1 commit into
base: release_23.1
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion lib/galaxy/job_execution/output_collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ def collect_primary_datasets(job_context: Union[JobContext, SessionlessJobContex
storage_callbacks=storage_callbacks,
)
# Associate new dataset with job
job_context.add_output_dataset_association(f"__new_primary_file_{name}|{designation}__", primary_data)
job_context.add_output_dataset_association(f"__new_primary_file_{name}|{filename_index}__", primary_data)
job_context.add_datasets_to_history([primary_data], for_output_dataset=outdata)
# Add dataset to return dict
primary_datasets[name][designation] = primary_data
Expand Down
7 changes: 4 additions & 3 deletions lib/galaxy/model/store/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,16 @@ def _populate_elements(self, chunk, name, root_collection_builder, metadata_sour
element_datasets["paths"].append(filename)

self.add_tags_to_datasets(datasets=element_datasets["datasets"], tag_lists=element_datasets["tag_lists"])
for element_identifiers, dataset in zip(element_datasets["element_identifiers"], element_datasets["datasets"]):
for i, (element_identifiers, dataset) in enumerate(
zip(element_datasets["element_identifiers"], element_datasets["datasets"])
):
current_builder = root_collection_builder
for element_identifier in element_identifiers[:-1]:
current_builder = current_builder.get_level(element_identifier)
current_builder.add_dataset(element_identifiers[-1], dataset)

# Associate new dataset with job
element_identifier_str = ":".join(element_identifiers)
association_name = f"__new_primary_file_{name}|{element_identifier_str}__"
association_name = f"__new_primary_file_{name}|{i}__"
self.add_output_dataset_association(association_name, dataset)

add_datasets_timer = ExecutionTimer()
Expand Down
2 changes: 1 addition & 1 deletion test/unit/app/tools/test_collect_primary_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def test_job_param(self):
self._collect_default_extra()
assert len(self.job.output_datasets) == 2
extra_job_assoc = [job_assoc for job_assoc in self.job.output_datasets if job_assoc.name.startswith("__")][0]
assert extra_job_assoc.name == "__new_primary_file_out1|test1__"
assert extra_job_assoc.name == "__new_primary_file_out1|0__"

def test_pattern_override_designation(self):
self._replace_output_collectors(
Expand Down