Skip to content

Commit a8005b0

Browse files
committed
Fix item_url bad query detection
1 parent 4dea48f commit a8005b0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

budgetkey_api/modules/simpledb.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ def check_for_common_errors(table, sql):
4242
'item multiple times. Use an exact match instead, e.g. "code = 12.34.56" or filter the query using the '
4343
'`level` field.'
4444
)
45-
group_by_item_url = re.search(r'group by.+item_url', sql, re.I | re.M | re.S | re.U)
46-
if group_by_item_url:
47-
ret.append(
48-
'Using "GROUP BY" with "item_url" may lead to unwanted results.'
49-
'If you are aggregating multiple items, remove the "item_url" from the query '
50-
'or use "ARRAY_AGG(item_url)"'
51-
)
45+
group_by_item_url = re.search(r'group by.+item_url', sql, re.I | re.M | re.S | re.U)
46+
if group_by_item_url:
47+
ret.append(
48+
'Using "GROUP BY" with "item_url" may lead to unwanted results.'
49+
'If you are aggregating multiple items, remove the "item_url" from the query '
50+
'or use "ARRAY_AGG(item_url)"'
51+
)
5252
return ret
5353

5454

0 commit comments

Comments
 (0)