Loading lib/galaxy/schema/fetch_data.py +1 −1 Original line number Diff line number Diff line Loading @@ -187,7 +187,7 @@ CompositeDataElement.update_forward_refs() class NestedElement(BaseDataElement): items: List["AnyElement"] = Field(..., alias="elements") items: List[Union["AnyElement", "NestedElement"]] = Field(..., alias="elements") AnyElement = Annotated[ Loading test/unit/webapps/api/test_fetch_schema.py +45 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,47 @@ recursive_archive_payload = { } nested_element_regression_payload = { "history_id": "80a1fcbe9fcb3c61", "targets": [ { "destination": {"type": "hdca"}, "elements": [ { "name": "a", "elements": [ { "name": "a", "elements": [ { "url": "https://example.com", "src": "url", "dbkey": "?", "ext": "auto", "name": "forward", }, { "url": "https://example.com", "src": "url", "dbkey": "?", "ext": "auto", "name": "reverse", }, ], "collection_type": "paired", }, ], "collection_type": "list:paired", }, ], "collection_type": "list:list:paired", "name": "a", } ], "auto_decompress": True, } def test_fetch_data_schema(): payload = FetchDataPayload(**example_payload) elements = payload.targets[0].items # type: ignore[union-attr] # alias doesn't type check properly Loading Loading @@ -113,3 +154,7 @@ def test_recursive_archive_form_like_data(): payload = deepcopy(recursive_archive_payload) payload["targets"] = dumps(payload["targets"]) FetchDataPayload(**payload) def test_nested_elemet_regression(): FetchDataPayload(**nested_element_regression_payload) Loading
lib/galaxy/schema/fetch_data.py +1 −1 Original line number Diff line number Diff line Loading @@ -187,7 +187,7 @@ CompositeDataElement.update_forward_refs() class NestedElement(BaseDataElement): items: List["AnyElement"] = Field(..., alias="elements") items: List[Union["AnyElement", "NestedElement"]] = Field(..., alias="elements") AnyElement = Annotated[ Loading
test/unit/webapps/api/test_fetch_schema.py +45 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,47 @@ recursive_archive_payload = { } nested_element_regression_payload = { "history_id": "80a1fcbe9fcb3c61", "targets": [ { "destination": {"type": "hdca"}, "elements": [ { "name": "a", "elements": [ { "name": "a", "elements": [ { "url": "https://example.com", "src": "url", "dbkey": "?", "ext": "auto", "name": "forward", }, { "url": "https://example.com", "src": "url", "dbkey": "?", "ext": "auto", "name": "reverse", }, ], "collection_type": "paired", }, ], "collection_type": "list:paired", }, ], "collection_type": "list:list:paired", "name": "a", } ], "auto_decompress": True, } def test_fetch_data_schema(): payload = FetchDataPayload(**example_payload) elements = payload.targets[0].items # type: ignore[union-attr] # alias doesn't type check properly Loading Loading @@ -113,3 +154,7 @@ def test_recursive_archive_form_like_data(): payload = deepcopy(recursive_archive_payload) payload["targets"] = dumps(payload["targets"]) FetchDataPayload(**payload) def test_nested_elemet_regression(): FetchDataPayload(**nested_element_regression_payload)