Skip to content

Commit 44782a4

Browse files
authored
Merge pull request #18023 from mvdbeek/fix_non_ready_collection_submission
[24.0] Raise appropriate exception if user forces a collection that is not populated with elements as input
2 parents 8f4968f + a671090 commit 44782a4

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lib/galaxy/tools/parameters/dataset_matcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def hdca_match(self, history_dataset_collection_association):
262262
def dataset_collection_match(self, dataset_collection):
263263
# If dataset collection not yet populated, cannot determine if it
264264
# would be a valid match for this parameter.
265-
if not dataset_collection.populated:
265+
if not dataset_collection.populated_optimized:
266266
return False
267267

268268
valid = True

lib/galaxy/tools/parameters/meta.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ def __expand_collection_parameter(trans, input_key, incoming_val, collections_to
242242
subcollection_type = None
243243
hdc_id = trans.app.security.decode_id(encoded_hdc_id)
244244
hdc = trans.sa_session.get(HistoryDatasetCollectionAssociation, hdc_id)
245+
if not hdc.collection.populated_optimized:
246+
raise exceptions.ToolInputsNotReadyException("An input collection is not populated.")
245247
collections_to_match.add(input_key, hdc, subcollection_type=subcollection_type, linked=linked)
246248
if subcollection_type is not None:
247249
subcollection_elements = subcollections.split_dataset_collection_instance(hdc, subcollection_type)

lib/galaxy_test/api/test_tools.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,9 +1659,8 @@ def test_map_over_collection(self, history_id):
16591659

16601660
@skip_without_tool("cat1")
16611661
def test_map_over_empty_collection(self, history_id):
1662-
hdca_id = self.dataset_collection_populator.create_list_in_history(history_id, contents=[]).json()["outputs"][
1663-
0
1664-
]["id"]
1662+
response = self.dataset_collection_populator.create_list_in_history(history_id, contents=[], wait=True).json()
1663+
hdca_id = response["output_collections"][0]["id"]
16651664
inputs = {
16661665
"input1": {"batch": True, "values": [{"src": "hdca", "id": hdca_id}]},
16671666
}

0 commit comments

Comments
 (0)