Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not allow setting benchmark and between-workflow caching for the same rule. The reason is that when the result is taken from cache, there is no way to fill the benchmark file with any reasonable values. #2335

Merged
merged 1 commit into from Jun 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions snakemake/workflow.py
Expand Up @@ -1620,6 +1620,15 @@ def decorate(ruleinfo):
"Invalid value for cache directive. Use True or 'omit-software'.",
rule=rule,
)
if ruleinfo.benchmark and self.get_cache_mode(rule):
raise WorkflowError(
"Rules with a benchmark directive may not be marked as eligible "
"for between-workflow caching at the same time. The reason is that "
"when the result is taken from cache, there is no way to fill the benchmark file with "
"any reasonable values. Either remove the benchmark directive or disable "
"between-workflow caching for this rule.",
rule=rule,
)

if ruleinfo.default_target is True:
self.default_target = rule.name
Expand Down