Skip to content

Commit

Permalink
Remove args check in filter_by_date
Browse files Browse the repository at this point in the history
The args check is already done where filter_by_date is referenced:
https://github.com/nextstrain/augur/blob/945b49af50cc72c4343673491531ae630db40040/augur/filter.py#L609

This avoids needing to update this condition in two places.
  • Loading branch information
victorlin committed Mar 29, 2022
1 parent b9e0c79 commit 5130fbd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions augur/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,8 @@ def filter_by_date(metadata, date_column="date", min_date=None, max_date=None):
"""
strains = set(metadata.index.values)

# Skip this filter if no valid min/max date is given or the date column does
# not exist.
if (not min_date and not max_date) or date_column not in metadata.columns:
# Skip this filter if the date column does not exist.
if date_column not in metadata.columns:
return strains

dates = get_numerical_dates(metadata, date_col=date_column, fmt="%Y-%m-%d")
Expand Down

0 comments on commit 5130fbd

Please sign in to comment.