Merge pull request #22287 from mvdbeek/fix-nested-dce-dynamic-option-filter

[26.0] Fix nested DatasetCollectionElement in dynamic options
This commit is contained in:
John Chilton
2026-03-29 14:44:14 -04:00
committed by GitHub
2 changed files with 24 additions and 4 deletions
@@ -1079,10 +1079,10 @@ def _get_ref_data(other_values, ref_name):
if is_runtime_value(ref):
return []
raise ValueError
if isinstance(ref, DatasetCollectionElement) and ref.hda:
ref = ref.hda
if isinstance(ref, DatasetCollectionElement):
return ref.dataset_instances
if isinstance(ref, (DatasetFilenameWrapper, HistoryDatasetAssociation, LibraryDatasetDatasetAssociation)):
ref = [ref]
return [ref]
elif isinstance(ref, HistoryDatasetCollectionAssociation):
ref = ref.to_hda_representative(multiple=True)
return ref.to_hda_representative(multiple=True)
return ref
+20
View File
@@ -286,6 +286,26 @@ class TestToolsApi(ApiTestCase, TestsTools):
assert "hg18_value" in option_values
assert "mm10_value" in option_values
@skip_without_tool("dbkey_filter_collection_input")
def test_run_dbkey_filter_nested_collection_dce(self):
with self.dataset_populator.test_history() as history_id:
list_list = self.dataset_collection_populator.create_list_of_list_in_history(history_id, wait=True).json()
# Set dbkey on the datasets in the inner list
for outer_element in list_list["elements"]:
for inner_element in outer_element["object"]["elements"]:
hda_id = inner_element["object"]["id"]
self.dataset_populator._put(
f"histories/{history_id}/contents/{hda_id}", {"genome_build": "hg19"}, json=True
)
# Get DCE ID of the inner list element - this is a DatasetCollectionElement
# wrapping a child collection (not an HDA)
dce_id = list_list["elements"][0]["id"]
inputs = {
"inputs": {"src": "dce", "id": dce_id},
"index": "hg19_value",
}
self._run("dbkey_filter_collection_input", history_id, inputs, assert_ok=True)
@skip_without_tool("cheetah_problem_unbound_var_input")
def test_legacy_biotools_xref_injection(self):
url = self._api_url("tools/cheetah_problem_unbound_var_input")