RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Fixed code error when mssql returns multiple columns (#4420)
so95f86d8906e73b
diff --git a/agent/component/exesql.py b/agent/component/exesql.pyindex dd210ad366..265256124b 100644--- a/agent/component/exesql.py+++ b/agent/component/exesql.py@@ -112,8 +112,11 @@ class ExeSQL(Generate, ABC):if cursor.rowcount == 0:sql_res.append({"content": "\nTotal: 0\n No record in the database!"})break- single_res = pd.DataFrame([i for i in cursor.fetchmany(self._param.top_n)])- single_res.columns = [i[0] for i in cursor.description]+ if self._param.db_type == 'mssql':+ single_res = pd.DataFrame.from_records(cursor.fetchmany(self._param.top_n),columns = [desc[0] for desc in cursor.description])+ else:+ single_res = pd.DataFrame([i for i in cursor.fetchmany(self._param.top_n)])+ single_res.columns = [i[0] for i in cursor.description]sql_res.append({"content": "\nTotal: " + str(cursor.rowcount) + "\n" + single_res.to_markdown()})breakexcept Exception as e:@@ -143,4 +146,4 @@ class ExeSQL(Generate, ABC):return Nonedef debug(self, **kwargs):- return self._run([], **kwargs)\ No newline at end of file+ return self._run([], **kwargs)