Skip to content

Commit

Permalink
Merge pull request #18023 from mvdbeek/fix_non_ready_collection_submi…
Browse files Browse the repository at this point in the history
…ssion

[24.0] Raise appropriate exception if user forces a collection that is not populated with elements as input
  • Loading branch information
mvdbeek authored Apr 22, 2024
2 parents 8f4968f + a671090 commit 44782a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/tools/parameters/dataset_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def hdca_match(self, history_dataset_collection_association):
def dataset_collection_match(self, dataset_collection):
# If dataset collection not yet populated, cannot determine if it
# would be a valid match for this parameter.
if not dataset_collection.populated:
if not dataset_collection.populated_optimized:
return False

valid = True
Expand Down
2 changes: 2 additions & 0 deletions lib/galaxy/tools/parameters/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ def __expand_collection_parameter(trans, input_key, incoming_val, collections_to
subcollection_type = None
hdc_id = trans.app.security.decode_id(encoded_hdc_id)
hdc = trans.sa_session.get(HistoryDatasetCollectionAssociation, hdc_id)
if not hdc.collection.populated_optimized:
raise exceptions.ToolInputsNotReadyException("An input collection is not populated.")
collections_to_match.add(input_key, hdc, subcollection_type=subcollection_type, linked=linked)
if subcollection_type is not None:
subcollection_elements = subcollections.split_dataset_collection_instance(hdc, subcollection_type)
Expand Down
5 changes: 2 additions & 3 deletions lib/galaxy_test/api/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1659,9 +1659,8 @@ def test_map_over_collection(self, history_id):

@skip_without_tool("cat1")
def test_map_over_empty_collection(self, history_id):
hdca_id = self.dataset_collection_populator.create_list_in_history(history_id, contents=[]).json()["outputs"][
0
]["id"]
response = self.dataset_collection_populator.create_list_in_history(history_id, contents=[], wait=True).json()
hdca_id = response["output_collections"][0]["id"]
inputs = {
"input1": {"batch": True, "values": [{"src": "hdca", "id": hdca_id}]},
}
Expand Down

0 comments on commit 44782a4

Please sign in to comment.