Skip to content

Commit 36ef67b

Browse files
committed
Merge branch 'release_24.1' into release_24.2
2 parents a55b61c + c967926 commit 36ef67b

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

lib/galaxy/tool_util/xsd/galaxy.xsd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7101,8 +7101,10 @@ paths for data or collection inputs set the ``data_style`` attribute to ``paths`
71017101
To include a dictionary with element identifiers, datatypes, staging paths, paths and metadata files set the ``data_style`` attribute to ``staging_path_and_source_path`` (element identifiers and datatypes are available since 24.0).
71027102
An example tool that uses ``staging_path_and_source_path`` is [inputs_as_json_with_staging_path_and_source_path.xml](https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/inputs_as_json_with_staging_path_and_source_path.xml)
71037103
7104-
Note that the element identifiers are stored as lists, where the last element is the actual element identifier of the dataset
7105-
and the other elements the identifiers of the collections containing the dataset.
7104+
Note that the ``element_identifier`` field matches the type of input, which means for simple data inputs ``element_identifier`` is a string,
7105+
for multiple="true" data inputs ``element_identifier`` is a list of strings corresponding to the element identifiers of each dataset passed to the input.
7106+
For dataset collections the element identifier is a list of strings with as many items in the list as the nesting level of the collection (i.e. 1 for list, 2 for list:list, 3 for list:list:list etc),
7107+
where the first item represents the outermost element identifier and the innermost item represents the innermost element identifier of the collection.
71067108
71077109
For tools with profile >= 20.05 a select with ``multiple="true"`` is rendered as an array which is empty if nothing is selected. For older profile versions select lists are rendered as comma separated strings or a literal ``null`` in case nothing is selected.
71087110
]]></xs:documentation>

lib/galaxy/tools/parameters/wrapped_json.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,8 @@ def data_input_to_staging_path_and_source_path(
7878
v: "DatasetFilenameWrapper", invalid_chars: Sequence[str] = ("/",)
7979
) -> Dict[str, Any]:
8080
staging_path = v.get_staging_path(invalid_chars=invalid_chars)
81-
# note that the element identifier should be always a list
8281
return {
83-
"element_identifier": [v.element_identifier],
82+
"element_identifier": v.element_identifier,
8483
"ext": v.file_ext,
8584
"staging_path": staging_path,
8685
"source_path": data_input_to_path(v),

test/functional/tools/inputs_as_json_with_staging_path_and_source_path.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ input_json_path = sys.argv[1]
1212
as_dict = json.load(open(input_json_path, "r"))
1313
1414
data_input_with_staging_details = as_dict["data_input"]
15-
assert data_input_with_staging_details['element_identifier'] == ["1.tabular"]
15+
assert data_input_with_staging_details['element_identifier'] == "1.tabular"
1616
assert data_input_with_staging_details['ext'] == "tabular"
1717
assert data_input_with_staging_details['staging_path'] == "1.tabular.tabular"
1818
assert len(data_input_with_staging_details['metadata_files']) == 0
1919
2020
multiple_data_input_with_staging_details = as_dict["multiple_data_input"]
2121
assert len(multiple_data_input_with_staging_details) == 2
22-
assert multiple_data_input_with_staging_details[0]['element_identifier'] == ["simple_line.txt"]
22+
assert multiple_data_input_with_staging_details[0]['element_identifier'] == "simple_line.txt"
2323
assert multiple_data_input_with_staging_details[0]['ext'] == "txt"
2424
assert multiple_data_input_with_staging_details[0]['staging_path'] == "simple_line.txt.txt"
2525
assert len(multiple_data_input_with_staging_details[0]['metadata_files']) == 0

0 commit comments

Comments
 (0)