Skip to content

Commit

Permalink
Fixed bug when filtering for named/classified tax_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
crosenth committed May 31, 2024
1 parent 6f9e646 commit acd8746
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions taxtastic/taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,8 +833,11 @@ def species_below(self, tax_id):
return newc

def named(self, no_rank=True):
nodes = self.nodes
names = self.names
s = select(names.c.tax_id).where(names.c.is_classified)
s = select(nodes.c.tax_id)
s = s.join(nodes, nodes.c.tax_id == names.c.tax_id)
s = s.where(names.c.is_classified)
if not no_rank:
s = s.where(names.c.rank != 'no_rank')
s = s.where(nodes.c.rank != 'no_rank')
return [f[0] for f in self.fetchall(s)]

0 comments on commit acd8746

Please sign in to comment.