Skip to content

Commit

Permalink
fix: don't raise WorkflowError when entry is empty (#1368)
Browse files Browse the repository at this point in the history
- Modify function 'check_output_duplicates' to check for empty value
  - Complete docstring
  - Add period at the end of raise message
  - Closes #1367
  • Loading branch information
vinisalazar committed Feb 5, 2022
1 parent 6200652 commit 1fc6f7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions snakemake/rules.py
Expand Up @@ -434,7 +434,7 @@ def set_output(self, *output, **kwoutput):

def check_output_duplicates(self):
"""Check ``Namedlist`` for duplicate entries and raise a ``WorkflowError``
on problems.
on problems. Does not raise if the entry is empty.
"""
seen = dict()
idx = None
Expand All @@ -444,10 +444,10 @@ def check_output_duplicates(self):
idx = 0
else:
idx += 1
if value in seen:
if value and value in seen:
raise WorkflowError(
"Duplicate output file pattern in rule {}. First two "
"duplicate for entries {} and {}".format(
"duplicate for entries {} and {}.".format(
self.name, seen[value], name or idx
)
)
Expand Down

0 comments on commit 1fc6f7b

Please sign in to comment.