You've already forked pgvecto.rs
mirror of
https://github.com/tensorchord/pgvecto.rs.git
synced 2025-08-01 06:46:52 +03:00
feat: enhance the __init__ of client (#164)
* enhance the __init__ of client Signed-off-by: 盐粒 Yanli <mail@yanli.one> * bump version Signed-off-by: 盐粒 Yanli <mail@yanli.one> --------- Signed-off-by: 盐粒 Yanli <mail@yanli.one>
This commit is contained in:
@ -32,19 +32,12 @@ class MockEmbedder:
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def client():
|
||||
client = PGVectoRs(db_url=URL, collection_name="empty", dimension=3)
|
||||
try:
|
||||
records1 = [
|
||||
Record.from_text(t, v, {"src": "src1"}) for t, v in MockTexts.items()
|
||||
]
|
||||
records2 = [
|
||||
Record.from_text(t, v, {"src": "src2"}) for t, v in MockTexts.items()
|
||||
]
|
||||
client.insert(records1)
|
||||
client.insert(records2)
|
||||
yield client
|
||||
finally:
|
||||
client.drop()
|
||||
client = PGVectoRs(db_url=URL, collection_name="empty", dimension=3, recreate=True)
|
||||
records1 = [Record.from_text(t, v, {"src": "src1"}) for t, v in MockTexts.items()]
|
||||
records2 = [Record.from_text(t, v, {"src": "src2"}) for t, v in MockTexts.items()]
|
||||
client.insert(records1)
|
||||
client.insert(records2)
|
||||
return client
|
||||
|
||||
|
||||
filter_src1 = filters.meta_contains({"src": "src1"})
|
||||
|
Reference in New Issue
Block a user