Skip to content

Commit 2ea5a14

Browse files
committed
Fix imports
1 parent 209f13d commit 2ea5a14

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

libs/langchain-mongodb/langchain_mongodb/vectorstores.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from pymongo import MongoClient
2626
from pymongo.collection import Collection
2727
from pymongo.errors import CollectionInvalid
28-
from pymongo_vectorsearch_utils import bulk_embed_and_insert_texts
28+
from pymongo_search_utils import bulk_embed_and_insert_texts
2929

3030
from langchain_mongodb.index import (
3131
create_vector_search_index,
@@ -357,7 +357,7 @@ def add_texts(
357357
metadatas_batch = []
358358
size = 0
359359
i = 0
360-
for j, (text, metadata) in enumerate(zip(texts, _metadatas)):
360+
for j, (text, metadata) in enumerate(zip(texts, _metadatas, strict=False)):
361361
size += len(text) + len(metadata)
362362
texts_batch.append(text)
363363
metadatas_batch.append(metadata)
@@ -446,7 +446,8 @@ def add_documents(
446446
start = 0
447447
for end in range(batch_size, n_docs + batch_size, batch_size):
448448
texts, metadatas = zip(
449-
*[(doc.page_content, doc.metadata) for doc in documents[start:end]]
449+
*[(doc.page_content, doc.metadata) for doc in documents[start:end]],
450+
strict=False,
450451
)
451452
result_ids.extend(
452453
bulk_embed_and_insert_texts(

libs/langchain-mongodb/tests/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from pymongo.driver_info import DriverInfo
2727
from pymongo.operations import SearchIndexModel
2828
from pymongo.results import BulkWriteResult, DeleteResult, InsertManyResult
29-
from pymongo_vectorsearch_utils import bulk_embed_and_insert_texts
29+
from pymongo_search_utils import bulk_embed_and_insert_texts
3030

3131
from langchain_mongodb import MongoDBAtlasVectorSearch
3232
from langchain_mongodb.agent_toolkit.database import MongoDBDatabase

0 commit comments

Comments
 (0)