Skip to content

Commit 0e8ed82

Browse files
authored
feat: support for commas in wildcards (#56)
1 parent 314325a commit 0e8ed82

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • snakemake_interface_executor_plugins

snakemake_interface_executor_plugins/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,15 @@ def encode_target_jobs_cli_args(
9797
target_jobs: List[TargetSpec],
9898
) -> List[str]:
9999
items = []
100+
def add_quotes_if_contains_comma(s):
101+
if isinstance(s, str):
102+
if "," in s:
103+
return f'"{s}"'
104+
return s
105+
100106
for spec in target_jobs:
101107
wildcards = ",".join(
102-
f"{key}={value}" for key, value in spec.wildcards_dict.items()
108+
f'{key}={add_quotes_if_contains_comma(value)}' for key, value in spec.wildcards_dict.items()
103109
)
104110
items.append(f"{spec.rulename}:{wildcards}")
105111
return items

0 commit comments

Comments
 (0)