Open standage opened 2 years ago
Duplicate of https://github.com/snakemake/snakemake/issues/1698?
As an aside, I found that by assigning the config value to a key in the params block, Snakemake was able to catch and report the issue.
This should be because the dag is evaluated before running the run
, script
, and shell
directives.
Duplicate of #1698?
Yes!
I recently spent a lot of time chasing down a bug in one of my Snakemake workflows, which ended up being the result of a typo: the key used in the Snakefile didn't match the key in the config file, in one case. This was in a
run
block instead of ashell
block, and Snakemake didn't provide any hints as to the cause of the failure.I've created a minimal example.
If I run Snakemake with
message
declared properly, the workflow runs without any issues.But if I run Snakemake with an incomplete or improper config, it fails without any hints.
Without knowing much about Snakemake's internal implementation, I'm guessing blocks of Python code aren't inspected much by Snakemake except for syntax checks. So any runtime errors aren't going to be discovered until the Python interpreter attempts to execute the code. Is there no straightforward way to catch and report e.g.
IndexError
s when Python code attempts to access an undeclared config value?