frappe / insights

Open Source Business Intelligence Tool
https://frappe.io/insights
GNU Affero General Public License v3.0
458 stars 225 forks source link

Unable to modify limit in Table Chart #332

Closed zaheer-srushty closed 7 hours ago

zaheer-srushty commented 4 weeks ago

By default, the Table Chart displays 100 rows. It is not showing the entire row result. If the limit is increased, then anl SQL error is raised.

Screenshot_20241022-135008

This gives a SELECT error whereas I was thinking the SQL syntax should be applying the LIMIT keyword.

nextchamp-saqib commented 3 weeks ago

I can't replicate the issue. The limit is applied correctly. Can you share the chart options that you have set?

zaheer-srushty commented 3 weeks ago

Here's the chart options

image

nextchamp-saqib commented 3 weeks ago

It works for me with the same options, can you try creating a new table chart with the same options and check if you can replicate it again?

donnieferdian commented 1 week ago

hi, @nextchamp-saqib I’m having a same problem with the limit value. When I increase or decrease it from 100

~/development$ bench version
frappe 15.x.x-develop
insights 3.0.2
Error Log ``` (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(SELECT 1000 FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `su...' at line 1") Traceback with variables (most recent call last): File "apps/frappe/frappe/app.py", line 118, in application response = frappe.api.handle(request) request = response = None rollback = True e = ProgrammingError(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(SELECT 1000 FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `su...' at line 1") File "apps/frappe/frappe/api/__init__.py", line 49, in handle data = endpoint(**arguments) request = endpoint = arguments = {'method': 'insights.api.workbooks.fetch_query_results'} File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call return frappe.handler.handle() method = 'insights.api.workbooks.fetch_query_results' frappe = File "apps/frappe/frappe/handler.py", line 49, in handle data = execute_cmd(cmd) cmd = 'insights.api.workbooks.fetch_query_results' data = None File "apps/frappe/frappe/handler.py", line 85, in execute_cmd return frappe.call(method, **frappe.form_dict) cmd = 'insights.api.workbooks.fetch_query_results' from_async = False server_script = None method = File "apps/frappe/frappe/__init__.py", line 1807, in call return fn(*args, **newargs) fn = args = () kwargs = {'use_live_connection': True, 'operations': [{'table': {'data_source': 'distribution', 'table_name': 'tabPrice List', 'type': 'table'}, 'type': 'source'}, {'column_names': ['name'], 'type': 'select'}, {'join_condition': {'left_column': {'column_name': 'name', 'type': 'column'}, 'right_column': {'column_name': 'price_list', 'type': 'column'}}, 'join_type': 'left', 'select_columns': [{'column_name': 'item_code', 'type': 'column'}, {'column_name': 'price_list_rate', 'type': 'column'}], 'table': {'data_source': 'distributin', 'table_name': 'tabItem Price', 'type': 'table'}, 'type': 'join'}, {'filters': [{'column': {'column_name': 'price_list', 'type': 'column'}, 'operator': 'in', 'value': ['Wholesale Selling Price']}], 'logical_operator': 'And', 'type': 'filter_group'}, {'type': 'summarize', 'measures': [{'aggregation': 'sum', 'column_name': 'price_list_rate', 'data_type': 'Decimal', 'label': 'sum(price_list_rate)', 'measure_name': 'sum(price_list_rate)', 'valu... newargs = {'use_live_connection': True, 'operations': [{'table': {'data_source': 'distribution', 'table_name': 'tabPrice List', 'type': 'table'}, 'type': 'source'}, {'column_names': ['name'], 'type': 'select'}, {'join_condition': {'left_column': {'column_name': 'name', 'type': 'column'}, 'right_column': {'column_name': 'price_list', 'type': 'column'}}, 'join_type': 'left', 'select_columns': [{'column_name': 'item_code', 'type': 'column'}, {'column_name': 'price_list_rate', 'type': 'column'}], 'table': {'data_source': 'distribution', 'table_name': 'tabItem Price', 'type': 'table'}, 'type': 'join'}, {'filters': [{'column': {'column_name': 'price_list', 'type': 'column'}, 'operator': 'in', 'value': ['Wholesale Selling Price']}], 'logical_operator': 'And', 'type': 'filter_group'}, {'type': 'summarize', 'measures': [{'aggregation': 'sum', 'column_name': 'price_list_rate', 'data_type': 'Decimal', 'label': 'sum(price_list_rate)', 'measure_name': 'sum(price_list_rate)', 'valu... File "apps/frappe/frappe/utils/typing_validations.py", line 32, in wrapper return func(*args, **kwargs) args = () kwargs = {'use_live_connection': True, 'operations': [{'table': {'data_source': 'distribution', 'table_name': 'tabPrice List', 'type': 'table'}, 'type': 'source'}, {'column_names': ['name'], 'type': 'select'}, {'join_condition': {'left_column': {'column_name': 'name', 'type': 'column'}, 'right_column': {'column_name': 'price_list', 'type': 'column'}}, 'join_type': 'left', 'select_columns': [{'column_name': 'item_code', 'type': 'column'}, {'column_name': 'price_list_rate', 'type': 'column'}], 'table': {'data_source': 'distribution', 'table_name': 'tabItem Price', 'type': 'table'}, 'type': 'join'}, {'filters': [{'column': {'column_name': 'price_list', 'type': 'column'}, 'operator': 'in', 'value': ['Wholesale Selling Price']}], 'logical_operator': 'And', 'type': 'filter_group'}, {'type': 'summarize', 'measures': [{'aggregation': 'sum', 'column_name': 'price_list_rate', 'data_type': 'Decimal', 'label': 'sum(price_list_rate)', 'measure_name': 'sum(price_list_rate)', 'valu... apply_condition = .innerfn.. at 0x72d70eda6660> func = .decorator..wrapper at 0x72d70eda67a0> File "apps/insights/insights/decorators.py", line 18, in wrapper return function(*args, **kwargs) args = () kwargs = {'use_live_connection': True, 'operations': [{'table': {'data_source': 'distribution', 'table_name': 'tabPrice List', 'type': 'table'}, 'type': 'source'}, {'column_names': ['name'], 'type': 'select'}, {'join_condition': {'left_column': {'column_name': 'name', 'type': 'column'}, 'right_column': {'column_name': 'price_list', 'type': 'column'}}, 'join_type': 'left', 'select_columns': [{'column_name': 'item_code', 'type': 'column'}, {'column_name': 'price_list_rate', 'type': 'column'}], 'table': {'data_source': 'distribution', 'table_name': 'tabItem Price', 'type': 'table'}, 'type': 'join'}, {'filters': [{'column': {'column_name': 'price_list', 'type': 'column'}, 'operator': 'in', 'value': ['Wholesale Selling Price']}], 'logical_operator': 'And', 'type': 'filter_group'}, {'type': 'summarize', 'measures': [{'aggregation': 'sum', 'column_name': 'price_list_rate', 'data_type': 'Decimal', 'label': 'sum(price_list_rate)', 'measure_name': 'sum(price_list_rate)', 'valu... function = .decorator..wrapper at 0x72d70eda6700> role = 'Insights User' File "apps/insights/insights/decorators.py", line 167, in wrapper return function(*args, **kwargs) args = () kwargs = {'use_live_connection': True, 'operations': [{'table': {'data_source': 'distribution', 'table_name': 'tabPrice List', 'type': 'table'}, 'type': 'source'}, {'column_names': ['name'], 'type': 'select'}, {'join_condition': {'left_column': {'column_name': 'name', 'type': 'column'}, 'right_column': {'column_name': 'price_list', 'type': 'column'}}, 'join_type': 'left', 'select_columns': [{'column_name': 'item_code', 'type': 'column'}, {'column_name': 'price_list_rate', 'type': 'column'}], 'table': {'data_source': 'distribution', 'table_name': 'tabItem Price', 'type': 'table'}, 'type': 'join'}, {'filters': [{'column': {'column_name': 'price_list', 'type': 'column'}, 'operator': 'in', 'value': ['Wholesale Selling Price']}], 'logical_operator': 'And', 'type': 'filter_group'}, {'type': 'summarize', 'measures': [{'aggregation': 'sum', 'column_name': 'price_list_rate', 'data_type': 'Decimal', 'label': 'sum(price_list_rate)', 'measure_name': 'sum(price_list_rate)', 'valu... function = File "apps/insights/insights/api/workbooks.py", line 22, in fetch_query_results results = execute_ibis_query(ibis_query, limit=limit, cache_expiry=60 * 10) operations = [{'table': {'data_source': 'distribution', 'table_name': 'tabPrice List', 'type': 'table'}, 'type': 'source'}, {'column_names': ['name'], 'type': 'select'}, {'join_condition': {'left_column': {'column_name': 'name', 'type': 'column'}, 'right_column': {'column_name': 'price_list', 'type': 'column'}}, 'join_type': 'left', 'select_columns': [{'column_name': 'item_code', 'type': 'column'}, {'column_name': 'price_list_rate', 'type': 'column'}], 'table': {'data_source': 'distribution', 'table_name': 'tabItem Price', 'type': 'table'}, 'type': 'join'}, {'filters': [{'column': {'column_name': 'price_list', 'type': 'column'}, 'operator': 'in', 'value': ['Wholesale Selling Price']}], 'logical_operator': 'And', 'type': 'filter_group'}, {'type': 'summarize', 'measures': [{'aggregation': 'sum', 'column_name': 'price_list_rate', 'data_type': 'Decimal', 'label': 'sum(price_list_rate)', 'measure_name': 'sum(price_list_rate)', 'value': 'sum(price_list_rate)'}], 'dimensions': ... limit = '1000' use_live_connection = True results = [] ibis_query = r0 := DatabaseTable: tabPrice List name !string creation timestamp(6) modified timestamp(6) modified_by string owner string docstatus !int32 idx !int32 enabled !int32 price_list_name string currency string buying !int32 selling !int32 price_not_uom_dependent !int32 _user_tags string _comments string _assign string _liked_by string r1 := DatabaseTable: tabItem Price name !string creation timestamp(6) modified timestamp(6) modified_by string owner string docstatus !int32 idx !int32 item_code string uom string packing_unit !int32 item_name string brand string item_description string pr... columns = [{'name': 'item_code', 'type': 'String'}, {'name': 'sum(price_list_rate)', 'type': 'Decimal'}] File "apps/insights/insights/insights/doctype/insights_data_source_v3/ibis_utils.py", line 516, in execute_ibis_query res: pd.DataFrame = query.execute() query = r0 := DatabaseTable: tabPrice List name !string creation timestamp(6) modified timestamp(6) modified_by string owner string docstatus !int32 idx !int32 enabled !int32 price_list_name string currency string buying !int32 selling !int32 price_not_uom_dependent !int32 _user_tags string _comments string _assign string _liked_by string r1 := DatabaseTable: tabItem Price name !string creation timestamp(6) modified timestamp(6) modified_by string owner string docstatus !int32 idx !int32 item_code string uom string packing_unit !int32 item_name string brand string item_description string pr... limit = 1000 cache = True cache_expiry = 600 sql = SQLString("SELECT\n *\nFROM (\n SELECT\n `t7`.`item_code`,\n SUM(`t7`.`price_list_rate`) AS `sum(price_list_rate)`\n FROM (\n SELECT\n *\n FROM (\n SELECT\n `t4`.`name`,\n `t5`.`price_list`,\n `t5`.`price_list_rate`,\n `t5`.`item_code`\n FROM (\n SELECT\n `t0`.`name`\n FROM `tabPrice List` AS `t0`\n ) AS `t4`\n LEFT OUTER JOIN (\n SELECT\n `t1`.`price_list`,\n `t1`.`price_list_rate`,\n `t1`.`item_code`\n FROM `tabItem Price` AS `t1`\n ) AS `t5`\n ON CAST(`t4`.`name` AS BINARY) = `t5`.`price_list`\n ) AS `t6`\n WHERE\n `t6`.`price_list` IN ('Wholesale Selling Price')\n ) AS `t7`\n GROUP BY\n 1\n LIMIT (\n SELECT\n 1000\n FROM (\n SELECT\n `t7`.`item_code`,\n SUM(`t7`.`price_list_rate`) AS `sum(price_list_rate)`\n FROM (\n SELECT\n *\n FROM (\n SELECT\n ... start = 295269.928820334 File "env/lib/python3.12/site-packages/ibis/expr/types/core.py", line 396, in execute return self._find_backend(use_default=True).execute( self = r0 := DatabaseTable: tabPrice List name !string creation timestamp(6) modified timestamp(6) modified_by string owner string docstatus !int32 idx !int32 enabled !int32 price_list_name string currency string buying !int32 selling !int32 price_not_uom_dependent !int32 _user_tags string _comments string _assign string _liked_by string r1 := DatabaseTable: tabItem Price name !string creation timestamp(6) modified timestamp(6) modified_by string owner string docstatus !int32 idx !int32 item_code string uom string packing_unit !int32 item_name string brand string item_description string pr... limit = 'default' params = None kwargs = {} File "env/lib/python3.12/site-packages/ibis/backends/mysql/__init__.py", line 375, in execute with self._safe_raw_sql(sql) as cur: self = expr = r0 := DatabaseTable: tabPrice List name !string creation timestamp(6) modified timestamp(6) modified_by string owner string docstatus !int32 idx !int32 enabled !int32 price_list_name string currency string buying !int32 selling !int32 price_not_uom_dependent !int32 _user_tags string _comments string _assign string _liked_by string r1 := DatabaseTable: tabItem Price name !string creation timestamp(6) modified timestamp(6) modified_by string owner string docstatus !int32 idx !int32 item_code string uom string packing_unit !int32 item_name string brand string item_description string pr... limit = 'default' kwargs = {'params': None} table = r0 := DatabaseTable: tabPrice List name !string creation timestamp(6) modified timestamp(6) modified_by string owner string docstatus !int32 idx !int32 enabled !int32 price_list_name string currency string buying !int32 selling !int32 price_not_uom_dependent !int32 _user_tags string _comments string _assign string _liked_by string r1 := DatabaseTable: tabItem Price name !string creation timestamp(6) modified timestamp(6) modified_by string owner string docstatus !int32 idx !int32 item_code string uom string packing_unit !int32 item_name string brand string item_description string pr... sql = "SELECT * FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `sum(price_list_rate)` FROM (SELECT * FROM (SELECT `t4`.`name`, `t5`.`price_list`, `t5`.`price_list_rate`, `t5`.`item_code` FROM (SELECT `t0`.`name` FROM `tabPrice List` AS `t0`) AS `t4` LEFT OUTER JOIN (SELECT `t1`.`price_list`, `t1`.`price_list_rate`, `t1`.`item_code` FROM `tabItem Price` AS `t1`) AS `t5` ON CAST(`t4`.`name` AS BINARY) = `t5`.`price_list`) AS `t6` WHERE `t6`.`price_list` IN ('Wholesale Selling Price')) AS `t7` GROUP BY 1 LIMIT (SELECT 1000 FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `sum(price_list_rate)` FROM (SELECT * FROM (SELECT `t4`.`name`, `t5`.`price_list`, `t5`.`price_list_rate`, `t5`.`item_code` FROM (SELECT `t0`.`name` FROM `tabPrice List` AS `t0`) AS `t4` LEFT OUTER JOIN (SELECT `t1`.`price_list`, `t1`.`price_list_rate`, `t1`.`item_code` FROM `tabItem Price` AS `t1`) AS `t5` ON `t5`.`price_list` = CAST(`t4`.`name` AS BINARY)) AS `t6` WHERE `t6`.`price_list` IN ('Wholes... schema = ibis.Schema { item_code string sum(price_list_rate) decimal(38, 9) } File "/usr/lib/python3.12/contextlib.py", line 137, in __enter__ return next(self.gen) self = File "env/lib/python3.12/site-packages/ibis/backends/mysql/__init__.py", line 270, in _safe_raw_sql with contextlib.closing(self.raw_sql(*args, **kwargs)) as result: self = args = ("SELECT * FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `sum(price_list_rate)` FROM (SELECT * FROM (SELECT `t4`.`name`, `t5`.`price_list`, `t5`.`price_list_rate`, `t5`.`item_code` FROM (SELECT `t0`.`name` FROM `tabPrice List` AS `t0`) AS `t4` LEFT OUTER JOIN (SELECT `t1`.`price_list`, `t1`.`price_list_rate`, `t1`.`item_code` FROM `tabItem Price` AS `t1`) AS `t5` ON CAST(`t4`.`name` AS BINARY) = `t5`.`price_list`) AS `t6` WHERE `t6`.`price_list` IN ('Wholesale Selling Price')) AS `t7` GROUP BY 1 LIMIT (SELECT 1000 FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `sum(price_list_rate)` FROM (SELECT * FROM (SELECT `t4`.`name`, `t5`.`price_list`, `t5`.`price_list_rate`, `t5`.`item_code` FROM (SELECT `t0`.`name` FROM `tabPrice List` AS `t0`) AS `t4` LEFT OUTER JOIN (SELECT `t1`.`price_list`, `t1`.`price_list_rate`, `t1`.`item_code` FROM `tabItem Price` AS `t1`) AS `t5` ON `t5`.`price_list` = CAST(`t4`.`name` AS BINARY)) AS `t6` WHERE `t6`.`price_list` IN ('Whole... kwargs = {} File "env/lib/python3.12/site-packages/ibis/backends/mysql/__init__.py", line 281, in raw_sql cursor.execute(query, **kwargs) self = query = "SELECT * FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `sum(price_list_rate)` FROM (SELECT * FROM (SELECT `t4`.`name`, `t5`.`price_list`, `t5`.`price_list_rate`, `t5`.`item_code` FROM (SELECT `t0`.`name` FROM `tabPrice List` AS `t0`) AS `t4` LEFT OUTER JOIN (SELECT `t1`.`price_list`, `t1`.`price_list_rate`, `t1`.`item_code` FROM `tabItem Price` AS `t1`) AS `t5` ON CAST(`t4`.`name` AS BINARY) = `t5`.`price_list`) AS `t6` WHERE `t6`.`price_list` IN ('Wholesale Selling Price')) AS `t7` GROUP BY 1 LIMIT (SELECT 1000 FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `sum(price_list_rate)` FROM (SELECT * FROM (SELECT `t4`.`name`, `t5`.`price_list`, `t5`.`price_list_rate`, `t5`.`item_code` FROM (SELECT `t0`.`name` FROM `tabPrice List` AS `t0`) AS `t4` LEFT OUTER JOIN (SELECT `t1`.`price_list`, `t1`.`price_list_rate`, `t1`.`item_code` FROM `tabItem Price` AS `t1`) AS `t5` ON `t5`.`price_list` = CAST(`t4`.`name` AS BINARY)) AS `t6` WHERE `t6`.`price_list` IN ('Wholes... kwargs = {} con = cursor = File "env/lib/python3.12/site-packages/pymysql/cursors.py", line 153, in execute result = self._query(query) self = query = "SELECT * FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `sum(price_list_rate)` FROM (SELECT * FROM (SELECT `t4`.`name`, `t5`.`price_list`, `t5`.`price_list_rate`, `t5`.`item_code` FROM (SELECT `t0`.`name` FROM `tabPrice List` AS `t0`) AS `t4` LEFT OUTER JOIN (SELECT `t1`.`price_list`, `t1`.`price_list_rate`, `t1`.`item_code` FROM `tabItem Price` AS `t1`) AS `t5` ON CAST(`t4`.`name` AS BINARY) = `t5`.`price_list`) AS `t6` WHERE `t6`.`price_list` IN ('Wholesale Selling Price')) AS `t7` GROUP BY 1 LIMIT (SELECT 1000 FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `sum(price_list_rate)` FROM (SELECT * FROM (SELECT `t4`.`name`, `t5`.`price_list`, `t5`.`price_list_rate`, `t5`.`item_code` FROM (SELECT `t0`.`name` FROM `tabPrice List` AS `t0`) AS `t4` LEFT OUTER JOIN (SELECT `t1`.`price_list`, `t1`.`price_list_rate`, `t1`.`item_code` FROM `tabItem Price` AS `t1`) AS `t5` ON `t5`.`price_list` = CAST(`t4`.`name` AS BINARY)) AS `t6` WHERE `t6`.`price_list` IN ('Wholes... args = None File "env/lib/python3.12/site-packages/pymysql/cursors.py", line 322, in _query conn.query(q) self = q = "SELECT * FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `sum(price_list_rate)` FROM (SELECT * FROM (SELECT `t4`.`name`, `t5`.`price_list`, `t5`.`price_list_rate`, `t5`.`item_code` FROM (SELECT `t0`.`name` FROM `tabPrice List` AS `t0`) AS `t4` LEFT OUTER JOIN (SELECT `t1`.`price_list`, `t1`.`price_list_rate`, `t1`.`item_code` FROM `tabItem Price` AS `t1`) AS `t5` ON CAST(`t4`.`name` AS BINARY) = `t5`.`price_list`) AS `t6` WHERE `t6`.`price_list` IN ('Wholesale Selling Price')) AS `t7` GROUP BY 1 LIMIT (SELECT 1000 FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `sum(price_list_rate)` FROM (SELECT * FROM (SELECT `t4`.`name`, `t5`.`price_list`, `t5`.`price_list_rate`, `t5`.`item_code` FROM (SELECT `t0`.`name` FROM `tabPrice List` AS `t0`) AS `t4` LEFT OUTER JOIN (SELECT `t1`.`price_list`, `t1`.`price_list_rate`, `t1`.`item_code` FROM `tabItem Price` AS `t1`) AS `t5` ON `t5`.`price_list` = CAST(`t4`.`name` AS BINARY)) AS `t6` WHERE `t6`.`price_list` IN ('Wholes... conn = File "env/lib/python3.12/site-packages/pymysql/connections.py", line 563, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) self = sql = b"SELECT * FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `sum(price_list_rate)` FROM (SELECT * FROM (SELECT `t4`.`name`, `t5`.`price_list`, `t5`.`price_list_rate`, `t5`.`item_code` FROM (SELECT `t0`.`name` FROM `tabPrice List` AS `t0`) AS `t4` LEFT OUTER JOIN (SELECT `t1`.`price_list`, `t1`.`price_list_rate`, `t1`.`item_code` FROM `tabItem Price` AS `t1`) AS `t5` ON CAST(`t4`.`name` AS BINARY) = `t5`.`price_list`) AS `t6` WHERE `t6`.`price_list` IN ('Wholesale Selling Price')) AS `t7` GROUP BY 1 LIMIT (SELECT 1000 FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `sum(price_list_rate)` FROM (SELECT * FROM (SELECT `t4`.`name`, `t5`.`price_list`, `t5`.`price_list_rate`, `t5`.`item_code` FROM (SELECT `t0`.`name` FROM `tabPrice List` AS `t0`) AS `t4` LEFT OUTER JOIN (SELECT `t1`.`price_list`, `t1`.`price_list_rate`, `t1`.`item_code` FROM `tabItem Price` AS `t1`) AS `t5` ON `t5`.`price_list` = CAST(`t4`.`name` AS BINARY)) AS `t6` WHERE `t6`.`price_list` IN ('Whole... unbuffered = False File "env/lib/python3.12/site-packages/pymysql/connections.py", line 825, in _read_query_result result.read() self = unbuffered = False result = File "env/lib/python3.12/site-packages/pymysql/connections.py", line 1199, in read first_packet = self.connection._read_packet() self = File "env/lib/python3.12/site-packages/pymysql/connections.py", line 775, in _read_packet packet.raise_for_error() self = packet_type = buff = bytearray(b"\xff(\x04#42000You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'(SELECT 1000 FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `su...\' at line 1") packet_header = b'\xed\x00\x00\x01' btrl = 237 btrh = 0 packet_number = 1 bytes_to_read = 237 recv_data = b"\xff(\x04#42000You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(SELECT 1000 FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `su...' at line 1" packet = File "env/lib/python3.12/site-packages/pymysql/protocol.py", line 219, in raise_for_error err.raise_mysql_exception(self._data) self = errno = 1064 File "env/lib/python3.12/site-packages/pymysql/err.py", line 150, in raise_mysql_exception raise errorclass(errno, errval) data = b"\xff(\x04#42000You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(SELECT 1000 FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `su...' at line 1" errno = 1064 errval = "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(SELECT 1000 FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `su...' at line 1" errorclass = pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(SELECT 1000 FROM (SELECT `t7`.`item_code`, SUM(`t7`.`price_list_rate`) AS `su...' at line 1") ```
nextchamp-saqib commented 7 hours ago

Should be fixed with 6ddbb9580b447376c27af464e5b38aa6e99d9bfd (v3.0.6)