Skip to content

Commit

Permalink
fix: fix error when passing callable as dpath or query of lookup func…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
johanneskoester committed Jan 30, 2024
1 parent 33f1637 commit 0e5b878
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion snakemake/ioutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ def inner(wildcards):
namespace[name] = value
else:
namespace = wildcards
resolved_expression = snakemake.utils.format(expression, **namespace)
if callable(expression):
resolved_expression = expression(wildcards)
else:
resolved_expression = expression
resolved_expression = snakemake.utils.format(
resolved_expression, **namespace
)
return self.apply_func(resolved_expression, namespace)

return inner
Expand Down

0 comments on commit 0e5b878

Please sign in to comment.