Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
baskaryan authored and jaceksan committed May 22, 2024
1 parent 2faf796 commit 4ff3079
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libs/community/langchain_community/vectorstores/duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import uuid
from typing import Any, Iterable, List, Optional, Type

import pandas as pd
from langchain_core.documents import Document
from langchain_core.embeddings import Embeddings
from langchain_core.vectorstores import VST, VectorStore
Expand Down Expand Up @@ -146,6 +145,14 @@ def add_texts(
List of ids of the added texts.
"""

try:
import pandas as pd
except ImportError as e:
raise ImportError(
"Unable to import pandas, please install it with "
"`pip install -U pandas`"
) from e

# Extract ids from kwargs or generate new ones if not provided
ids = kwargs.pop("ids", [str(uuid.uuid4()) for _ in texts])

Expand Down

0 comments on commit 4ff3079

Please sign in to comment.