frappe / insights

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

Facing Cursor has no len() while fetching data from dB I need to install insights v3 on frappe 14.23.0 ...help me to solve this issue #358

Open vishwastanch opened 4 days ago

vishwastanch commented 4 days ago

Traceback (most recent call last): File "apps/frappe/frappe/app.py", line 69, in application response = frappe.api.handle() File "apps/frappe/frappe/api.py", line 55, in handle return frappe.handler.handle() File "apps/frappe/frappe/handler.py", line 48, in handle data = execute_cmd(cmd) File "apps/frappe/frappe/handler.py", line 86, in execute_cmd return frappe.call(method, frappe.form_dict) File "apps/frappe/frappe/init.py", line 1595, in call return fn(*args, *newargs) File "apps/insights/insights/decorators.py", line 18, in wrapper return function(args, kwargs) File "apps/insights/insights/decorators.py", line 167, in wrapper return function(*args, *kwargs) File "apps/insights/insights/decorators.py", line 145, in wrapper return func(args, **kwargs) File "apps/insights/insights/api/data_sources.py", line 339, in get_data_source_table data = execute_ibis_query(q) File "apps/insights/insights/insights/doctype/insights_data_source_v3/ibis_utils.py", line 438, in execute_ibis_query result = query.execute() File "env/lib/python3.10/site-packages/ibis/expr/types/core.py", line 396, in execute return self._find_backend(use_default=True).execute( File "env/lib/python3.10/site-packages/ibis/backends/mysql/init.py", line 376, in execute result = self._fetch_from_cursor(cur, schema) File "env/lib/python3.10/site-packages/ibis/backends/mysql/init.py", line 548, in _fetch_from_cursor df = pd.DataFrame.from_records( File "env/lib/python3.10/site-packages/pandas/core/frame.py", line 2491, in from_records arrays, arr_columns = to_arrays(data, columns) File "env/lib/python3.10/site-packages/pandas/core/internals/construction.py", line 811, in to_arrays if not len(data): TypeError: object of type 'Cursor' has no len()

This error occurs while fetching data from the database. I can access the tables and columns, but I cant able to get the data.its showing object of type 'Cursor' has no len() every node version and IBIS versions al satisfied please give me the solution ..

nextchamp-saqib commented 2 days ago

Please update to the latest v14 version and check if the issue persists.

vishwastanch commented 2 days ago

This Issue solved by updating version pymysql 1.1.1 now its working properly for frappe 14.23