Skip to content

Commit 9f825f2

Browse files
committed
Improved asyncpg test [skip ci]
1 parent 8b92716 commit 9f825f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_asyncpg.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ async def test_vector_array(self):
110110
await register_vector(conn)
111111

112112
embeddings = [Vector([1.5, 2, 3]), Vector([4.5, 5, 6])]
113+
await conn.execute("INSERT INTO asyncpg_items (embeddings) VALUES ($1)", embeddings)
114+
113115
embeddings2 = [np.array([1.5, 2, 3]), np.array([4.5, 5, 6])]
114-
await conn.execute("INSERT INTO asyncpg_items (embeddings) VALUES (ARRAY[$1, $2]::vector[]), (ARRAY[$3, $4]::vector[])", embeddings[0], embeddings[1], embeddings2[0], embeddings2[1])
116+
await conn.execute("INSERT INTO asyncpg_items (embeddings) VALUES (ARRAY[$1, $2]::vector[])", embeddings2[0], embeddings2[1])
115117

116118
res = await conn.fetch("SELECT * FROM asyncpg_items ORDER BY id")
117119
assert np.array_equal(res[0]['embeddings'][0], embeddings[0].to_numpy())

0 commit comments

Comments
 (0)