mirror of
https://github.com/hwchase17/langchain.git
synced 2026-01-24 05:50:18 +00:00
community: Register pandas df in duckdb when creating vector_store (#23690)
- **Description:** Register pandas df in duckdb when creating vector_store - **Issue:** Resolves #23308 - **Dependencies:** None - **Twitter handle:** @timvw Co-authored-by: Tim Van Wassenhove <tim.van.wassenhove@telenetgroup.be>
This commit is contained in:
committed by
GitHub
parent
b60df8bb4f
commit
24916c6703
@@ -191,6 +191,7 @@ class DuckDB(VectorStore):
|
||||
if have_pandas:
|
||||
# noinspection PyUnusedLocal
|
||||
df = pd.DataFrame.from_dict(data) # noqa: F841
|
||||
self._connection.register("df", df)
|
||||
self._connection.execute(
|
||||
f"INSERT INTO {self._table_name} SELECT * FROM df",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user