Skip to content

Commit 4bc0bf2

Browse files
committed
attempt to properly deal with multiextValue under apply_wildcards & apply_default_storage
1 parent 174b570 commit 4bc0bf2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

snakemake/io.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,8 @@ def format_match(match):
10901090
except KeyError as ex:
10911091
raise WildcardError(str(ex))
10921092

1093+
if isinstance(pattern, MultiextValue):
1094+
return WILDCARD_REGEX.sub(format_match, pattern.prefix)
10931095
return WILDCARD_REGEX.sub(format_match, pattern)
10941096

10951097

snakemake/path_modifier.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ def is_annotated_callable(value):
117117
or is_flagged(path, "storage_object")
118118
or is_flagged(path, "local")
119119
or is_flagged(path, "sourcecache_entry")
120-
or is_flagged(path, "multiext")
121120
or is_annotated_callable(path)
122121
):
123122
# no default remote needed
@@ -127,7 +126,10 @@ def is_annotated_callable(value):
127126
prefix = self.workflow.storage_settings.default_storage_prefix
128127
if prefix and not prefix.endswith("/"):
129128
prefix = f"{prefix}/"
130-
query = f"{prefix}{os.path.normpath(path)}"
129+
if isinstance(path, MultiextValue):
130+
query = f"{prefix}{os.path.normpath(path.prefix)}"
131+
else:
132+
query = f"{prefix}{os.path.normpath(path)}"
131133
storage_object = self.workflow.storage_registry.default_storage_provider.object(
132134
query
133135
)

0 commit comments

Comments
 (0)