From 24916c670311400e780c82bdf513f579f71c5387 Mon Sep 17 00:00:00 2001 From: Tim Van Wassenhove Date: Mon, 1 Jul 2024 15:12:06 +0200 Subject: [PATCH] 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 --- libs/community/langchain_community/vectorstores/duckdb.py | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/community/langchain_community/vectorstores/duckdb.py b/libs/community/langchain_community/vectorstores/duckdb.py index e949d6ac1a..de333693ff 100644 --- a/libs/community/langchain_community/vectorstores/duckdb.py +++ b/libs/community/langchain_community/vectorstores/duckdb.py @@ -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", )