Skip to content

Commit

Permalink
Fix 'in' not working with columns
Browse files Browse the repository at this point in the history
  • Loading branch information
eito-fis committed Jul 1, 2021
1 parent d1faa3d commit d2d4424
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def get_group_counts(
for field in group_by:
if type(field) not in (str, Column):
raise BadGroupFormat(f"Group field {field} must be a string or Column.")
if field not in table.c:
field_name = field if type(field) == str else field.name
if field_name not in table.c:
raise GroupFieldNotFound(f"Group field {field} not found in {table}.")

group_by = _create_col_objects(table, group_by)
Expand Down

0 comments on commit d2d4424

Please sign in to comment.