Unverified Commit c9679269 authored by Nicola Soranzo's avatar Nicola Soranzo
Browse files

Merge branch 'release_24.0' into release_24.1

parents c4605dad e61a74b4
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -6813,8 +6813,10 @@ paths for data or collection inputs set the ``data_style`` attribute to ``paths`
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).
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)

Note that the element identifiers are stored as lists, where the last element is the actual element identifier of the dataset
and the other elements the identifiers of the collections containing the dataset.
Note that the ``element_identifier`` field matches the type of input, which means for simple data inputs ``element_identifier`` is a string,
for multiple="true" data inputs ``element_identifier`` is a list of strings corresponding to the element identifiers of each dataset passed to the input.
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),
where the first item represents the outermost element identifier and the innermost item represents the innermost element identifier of the collection.

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.
]]></xs:documentation>
+1 −2
Original line number Diff line number Diff line
@@ -78,9 +78,8 @@ def data_input_to_staging_path_and_source_path(
    v: "DatasetFilenameWrapper", invalid_chars: Sequence[str] = ("/",)
) -> Dict[str, Any]:
    staging_path = v.get_staging_path(invalid_chars=invalid_chars)
    # note that the element identifier should be always a list
    return {
        "element_identifier": [v.element_identifier],
        "element_identifier": v.element_identifier,
        "ext": v.file_ext,
        "staging_path": staging_path,
        "source_path": data_input_to_path(v),
+2 −2
Original line number Diff line number Diff line
@@ -12,14 +12,14 @@ input_json_path = sys.argv[1]
as_dict = json.load(open(input_json_path, "r"))

data_input_with_staging_details = as_dict["data_input"]
assert data_input_with_staging_details['element_identifier'] == ["1.tabular"]
assert data_input_with_staging_details['element_identifier'] == "1.tabular"
assert data_input_with_staging_details['ext'] == "tabular"
assert data_input_with_staging_details['staging_path'] == "1.tabular.tabular"
assert len(data_input_with_staging_details['metadata_files']) == 0

multiple_data_input_with_staging_details = as_dict["multiple_data_input"]
assert len(multiple_data_input_with_staging_details) == 2
assert multiple_data_input_with_staging_details[0]['element_identifier'] == ["simple_line.txt"]
assert multiple_data_input_with_staging_details[0]['element_identifier'] == "simple_line.txt"
assert multiple_data_input_with_staging_details[0]['ext'] == "txt"
assert multiple_data_input_with_staging_details[0]['staging_path'] == "simple_line.txt.txt"
assert len(multiple_data_input_with_staging_details[0]['metadata_files']) == 0