ExeSQL get tuple index out of range Error #2700
-
I am trying to use ExeSQL to perform the sql query, but sometimes it returns the error below. SELECT issue_number, customer_id, complaint_date, issue_description, solution_description FROM customer_issues WHERE solution_description LIKE '%abnormal vibration%'. I have tried to execute this sql from my python code (psycopg2) and it can return the correct result. I hope anyone can give me some hint to fix this problem. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I've submit an issue for that. |
Beta Was this translation helpful? Give feedback.
-
I have confirmed that the problem is caused by the Peewee package, I updated the code in ragflow/agent/component import re class ExeSQLParam(ComponentParamBase):
class ExeSQL(ComponentBase, ABC):
|
Beta Was this translation helpful? Give feedback.
I have confirmed that the problem is caused by the Peewee package, I updated the code in ragflow/agent/component
/exesql.py,
and after switching to pymysql and psycopg2 directly, it now works.
I've included the code below for your reference. It might not be perfect, but until a proper fix is in place, it can serve as a temporary workaround.
import re
import pandas as pd
import psycopg2
import pymysql
from abc import ABC
from agent.component.base import ComponentBase, ComponentParamBase
class ExeSQLParam(ComponentParamBase):
"""
Define the ExeSQL component parameters.
"""