From d53ef92e79f5e8cf0187a1aa25c321c1478914d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20K=C3=B6ster?= Date: Mon, 5 Feb 2024 16:51:43 +0100 Subject: [PATCH] fix: support list of queries for storage provider (#2674) ### Description ### QC * [ ] The PR contains a test case for the changes or the changes are already covered by an existing test case. * [ ] The documentation (`docs/`) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake). --- snakemake/storage.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/snakemake/storage.py b/snakemake/storage.py index 9f04dd4a0..673a56860 100644 --- a/snakemake/storage.py +++ b/snakemake/storage.py @@ -1,5 +1,5 @@ import copy -from typing import Any, Optional +from typing import Any, List, Optional, Union from snakemake.io import flag from snakemake.workflow import Workflow from snakemake_interface_common.exceptions import WorkflowError @@ -144,11 +144,19 @@ def __call__( def _storage_object( self, - query: str, + query: Union[str, List[str]], provider: Optional[str] = None, retrieve: bool = True, keep_local: bool = False, ): + if isinstance(query, list): + return [ + self._storage_object( + q, provider=provider, retrieve=retrieve, keep_local=keep_local + ) + for q in query + ] + provider_name = provider if provider_name is None: