-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Added manually tested sync methods for PGVector to AlloyDB migration #209
Conversation
502d2b8
to
e5ae00a
Compare
e5ae00a
to
46fe6f7
Compare
params = {} | ||
|
||
if use_json_metadata: | ||
insert_query = f"INSERT INTO {destination_table} (LANGCHAIN_ID, CONTENT, EMBEDDING, LANGCHAIN_METADATA) VALUES" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We get these default values from the file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the default values hardcoded here:
langchain-google-alloydb-pg-python/src/langchain_google_alloydb_pg/vectorstore.py
Line 104 in 783dcad
async def create( |
Which file can we extract them from?
The uuid corresponding to the collection. | ||
""" | ||
try: | ||
collection_info = self._fetch( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The upcoming refactor we will be deleting fetch/execute. Any where that you use fetch or execute use the async pool directly like async with self.engine.connect() as conn:...
. Then we will wrap the async methods with sync wrappers. For example extract_pgvector_collection could be _aextract_pgvector_collection. Then in extract_pgvector_collection we will use run_as_sync to run the _aextract_pgvector_collection methods. See https://github.com/googleapis/langchain-google-cloud-sql-pg-python/blob/c3a0f12276eef07a64ea40b20abe496496b5132c/src/langchain_google_cloud_sql_pg/engine.py#L364 for an example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll refactor this PR once the async/sync refactor is pushed.
630dd4f
to
c679a14
Compare
c679a14
to
f50e52e
Compare
e36078f
to
3f2584e
Compare
@twishabansal This PR can now be closed in favor of #235, correct? |
No description provided.