Compare commits

..

2 Commits

Author SHA1 Message Date
Gatefixer 41efbdaf83 test(python): clarify prefilter regression attribution 2026-08-08 13:03:58 +00:00
Gatefixer 04e97e4a36 test(python): cover filtered hybrid search results 2026-08-08 12:14:27 +00:00
2 changed files with 14 additions and 27 deletions
-27
View File
@@ -69,33 +69,6 @@ describe("given a connection", () => {
await expect(tbl.countRows()).resolves.toBe(1);
});
it("should isolate object-form table creation across databases", async () => {
const otherTmpDir = tmp.dirSync({ unsafeCleanup: true });
const otherDb = await connect(otherTmpDir.name);
try {
const firstTable = await db.createTable({
name: "defaultTable",
data: [{ rowId: "id1", vector: Array(384).fill(0) }],
});
const secondTable = await otherDb.createTable({
name: "defaultTable",
data: [{ rowId: "id2", vector: Array(384).fill(0) }],
});
await expect(db.tableNames()).resolves.toEqual(["defaultTable"]);
await expect(otherDb.tableNames()).resolves.toEqual(["defaultTable"]);
const firstRows = await firstTable.query().select(["rowId"]).toArray();
const secondRows = await secondTable.query().select(["rowId"]).toArray();
expect(firstRows.map((row) => row.rowId)).toEqual(["id1"]);
expect(secondRows.map((row) => row.rowId)).toEqual(["id2"]);
} finally {
otherDb.close();
otherTmpDir.removeCallback();
}
});
it("should be able to drop tables`", async () => {
await db.createTable("test", [{ id: 1 }, { id: 2 }]);
await db.createTable("test2", [{ id: 1 }, { id: 2 }]);
+14
View File
@@ -365,6 +365,20 @@ def test_hybrid_prefilter_explain_plan(table_with_id: Table):
)
def test_hybrid_prefilter_returns_filtered_row(table_with_id: Table):
"""Regression test for the hybrid prefilter inversion fixed in #3096."""
results = (
table_with_id.search(query_type="hybrid")
.vector([0.1, 0.1])
.text("dog")
.where("id = 3", prefilter=True)
.limit(1)
.to_arrow()
)
assert results["id"].to_pylist() == [3]
def test_normalize_scores():
cases = [
(pa.array([0.1, 0.4]), pa.array([0.0, 1.0])),