Skip to content
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

community: fix @embeddingKey in azure cosmos db no sql #27377

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

DBPhoenix
Copy link
Contributor

I will keep this PR as small as the changes made.

Description: fixes a fatal bug syntax error in AzureCosmosDBNoSqlVectorSearch
Issue: #27269 #25468

Copy link

vercel bot commented Oct 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Oct 15, 2024 8:27pm

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. community Related to langchain-community Ɑ: vector store Related to vector store module 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Oct 15, 2024
@codenamics
Copy link

when it will be merged?

@DBPhoenix
Copy link
Contributor Author

when it will be merged?

I am no expert so anyone should feel free to correct me. But it seems the status "Needs support" means that the PR is on hold until it reaches more engagement. Therefore check the changes out, confirm that they work for you, and use the +1 on the post to voice your opinion.

)

# Add where_clause if specified
if pre_filter is not None and pre_filter.get("where_clause") is not None:
query += " {}".format(pre_filter["where_clause"])

query += " ORDER BY VectorDistance(c.@embeddingKey, @embeddings)"
query += " ORDER BY VectorDistance(c[@embeddingKey], @embeddings)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very familiar with Azure CDB NoSQL but is c.@embeddingKey equivalent to c[@embeddingKey]? Why make this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, the dot syntax is not supported for variable expressions. You are therefore forced to use brackets if you want to protect yourself against injections. CDB NoSQL seems quite restrictive in its capabilities here. But I do not have greater proficiency in it either, so there may be smarter ways about it.

@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Oct 31, 2024
@ccurme ccurme enabled auto-merge (squash) October 31, 2024 18:33
@ccurme ccurme merged commit 389771c into langchain-ai:master Oct 31, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature community Related to langchain-community lgtm PR looks good. Use to confirm that a PR is ready for merging. size:XS This PR changes 0-9 lines, ignoring generated files. Ɑ: vector store Related to vector store module
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants