Skip to content

Commit

Permalink
fix: support list of queries for storage provider (#2674)
Browse files Browse the repository at this point in the history
### Description

<!--Add a description of your PR here-->

### QC
<!-- Make sure that you can tick the boxes below. -->

* [ ] 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).
  • Loading branch information
johanneskoester committed Feb 5, 2024
1 parent 805dd0c commit d53ef92
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions 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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit d53ef92

Please sign in to comment.