Skip to content

Commit

Permalink
Merge pull request #2846 from roed314/counts
Browse files Browse the repository at this point in the history
Fix bug in column_counts
  • Loading branch information
AndrewVSutherland committed Mar 22, 2019
2 parents 796af02 + 82aa659 commit 6fdeb88
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lmfdb/backend/database.py
Expand Up @@ -3632,9 +3632,12 @@ def make_tuple(val, top_level=True):
return {make_tuple(rec[0]): rec[1] for rec in cur}
else:
constraint_list = [(i, constraint[col]) for (i, col) in enumerate(allcols) if col in constraint]
column_indexes = [i for (i, col) in enumerate(allcols) if col not in constraint]
def satisfies_constraint(val):
return all(val[i] == c for i,c in constraint_list)
return {make_tuple(rec[0]): rec[1] for rec in cur if satisfies_constraint(rec[0])}
def remove_constraint(val):
return [val[i] for i in column_indexes]
return {make_tuple(remove_constraint(rec[0])): rec[1] for rec in cur if satisfies_constraint(rec[0])}

def _quick_max(self, col, ccols, cvals):
if ccols is None:
Expand Down

0 comments on commit 6fdeb88

Please sign in to comment.