Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Fix broken test with duckdb 2.0+ #1312

davidmezzetti8e89580deacb
diff --git a/test/python/testdatabase/testduckdb.py b/test/python/testdatabase/testduckdb.py
index b4e45e0b..500f9cd9 100644
--- a/test/python/testdatabase/testduckdb.py
+++ b/test/python/testdatabase/testduckdb.py
@@ -5,7 +5,7 @@ DuckDB module tests
import os
import unittest
-from txtai.database import DuckDB, SQLError
+from txtai.database import SQLError
from txtai.embeddings import Embeddings
from .testrdbms import Common
@@ -54,13 +54,7 @@ class TestDuckDB(Common.TestRDBMS):
embeddings = Embeddings(keyword=True, content=self.backend)
embeddings.index([(0, "apple pie", None), (1, "banana bread", None)])
- # Catalog errors don't abort the transaction
- with self.assertRaises(SQLError) as context:
- embeddings.search("select id from txtai where unknownfn(text)")
-
- self.assertNotIn(DuckDB.ABORTED, str(context.exception))
-
- # Runtime errors abort the transaction
+ # All errors abort the transaction
with self.assertRaises(SQLError) as context:
embeddings.search("select id from txtai where text = :x", parameters={"x": 1})