Skip to content

Commit 9483a64

Browse files
fix: fix error message of evaluate helper function (#3282)
<!--Add a description of your PR here--> ### QC <!-- Make sure that you can tick the boxes below. --> * [x] The PR contains a test case for the changes or the changes are already covered by an existing test case. * [x] 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). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Exposed evaluation functionality for processing Python expressions with wildcard parameters. - **Bug Fixes** - Enhanced error reporting with more structured and clear diagnostic messages for easier troubleshooting. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 9610f7c commit 9483a64

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

snakemake/ioutils/evaluate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from snakemake.logging import format_dict
12
from snakemake_interface_common.exceptions import WorkflowError
23

34

@@ -11,7 +12,7 @@ def inner(wildcards):
1112
return eval(formatted, globals())
1213
except Exception as e:
1314
raise WorkflowError(
14-
f"Failed to evaluate expression {expr} with wildcards {wildcards}. "
15+
f"Failed to evaluate expression {expr} with wildcards {format_dict(wildcards)}. "
1516
f"Formatted expression: {formatted}",
1617
e,
1718
)

0 commit comments

Comments
 (0)