Skip to content

Commit 417f3ec

Browse files
committed
Improved test [skip ci]
1 parent 2ff631e commit 417f3ec

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tests/test_sqlalchemy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,13 +425,12 @@ def test_automap(self):
425425
assert item.embedding.tolist() == [1, 2, 3]
426426

427427
def test_vector_array(self):
428-
from pgvector.psycopg2 import register_vector
429-
430428
session = Session(engine)
431429
session.add(Item(id=1, embeddings=[np.array([1, 2, 3]), np.array([4, 5, 6])]))
432430
session.commit()
433431

434432
with engine.connect() as connection:
433+
from pgvector.psycopg2 import register_vector
435434
register_vector(connection.connection.dbapi_connection, globally=False, arrays=True)
436435

437436
# this fails if the driver does not cast arrays

0 commit comments

Comments
 (0)