Site: insights.test
Form Dict: {'doctype': 'Insights Query', 'fields': ['name', 'title', 'status', 'is_assisted_query', 'is_native_query', 'is_script_query', 'is_stored', 'data_source', 'creation', 'owner', 'owner_name', 'owner_image', 'chart_type'], 'filters': {}, 'order_by': 'creation desc', 'start': 0, 'limit': 50, 'limit_start': 0, 'limit_page_length': 50, 'debug': 0, 'cmd': 'insights.api.queries.get_queries'}
Traceback (most recent call last):
File "/home/karan/frappe/frappe-bench/apps/frappe/frappe/app.py", line 110, in application
response = frappe.api.handle(request)
File "/home/karan/frappe/frappe-bench/apps/frappe/frappe/api/__init__.py", line 49, in handle
data = endpoint(**arguments)
File "/home/karan/frappe/frappe-bench/apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
return frappe.handler.handle()
File "/home/karan/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 49, in handle
data = execute_cmd(cmd)
File "/home/karan/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/karan/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1803, in call
return fn(*args, **newargs)
File "/home/karan/frappe/frappe-bench/apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
return func(*args, **kwargs)
File "/home/karan/frappe/frappe-bench/apps/insights/insights/decorators.py", line 15, in wrapper
return function(*args, **kwargs)
File "/home/karan/frappe/frappe-bench/apps/insights/insights/api/queries.py", line 21, in get_queries
return (
File "/home/karan/frappe/frappe-bench/apps/frappe/frappe/query_builder/utils.py", line 84, in execute_query
result = frappe.db.sql(query, params, *args, **kwargs) # nosemgrep
File "/home/karan/frappe/frappe-bench/apps/frappe/frappe/database/postgres/database.py", line 220, in sql
return super().sql(modify_query(query), modify_values(values), *args, **kwargs)
File "/home/karan/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 237, in sql
self._cursor.execute(query, values)
psycopg2.errors.GroupingError: column "tabUser.full_name" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: ...hts Query"."creation","tabInsights Query"."owner","tabUser"...
Description of issue:
Here,
https://github.com/frappe/insights/blob/7950b5a9215e4bab5afbc656af53fec272e0aa93/insights/api/queries.py#L45
the issue is happening while grouping it. It got resolved by placing
in group by.