mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +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:
parent
b60df8bb4f
commit
24916c6703
@ -191,6 +191,7 @@ class DuckDB(VectorStore):
|
|||||||
if have_pandas:
|
if have_pandas:
|
||||||
# noinspection PyUnusedLocal
|
# noinspection PyUnusedLocal
|
||||||
df = pd.DataFrame.from_dict(data) # noqa: F841
|
df = pd.DataFrame.from_dict(data) # noqa: F841
|
||||||
|
self._connection.register("df", df)
|
||||||
self._connection.execute(
|
self._connection.execute(
|
||||||
f"INSERT INTO {self._table_name} SELECT * FROM df",
|
f"INSERT INTO {self._table_name} SELECT * FROM df",
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user