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

fix(community): PrismaVectorStore handle empty array in filter #7254

Merged

Conversation

shan-mx
Copy link
Contributor

@shan-mx shan-mx commented Nov 24, 2024

When an an empty array is passed to IN or NOTIN operator in PrismaVectorStore's filter, it will be directly passed to Prisma.join and cause
TypeError: Expected join([]) to be called with an array of multiple elements, but got an empty array

This PR adds a separate logic for handling empty arrays in SQL queries:

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Nov 24, 2024
Copy link

vercel bot commented Nov 24, 2024

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

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Nov 25, 2024 5:44pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Nov 25, 2024 5:44pm

@dosubot dosubot bot added the auto:bug Related to a bug, vulnerability, unexpected error with an existing feature label Nov 24, 2024
@shan-mx shan-mx changed the title community[patch]: fix PrismaVectorStore for empty array handling fix(community): PrismaVectorStore handle empty array in filter Nov 24, 2024
Copy link
Collaborator

@jacoblee93 jacoblee93 left a comment

Choose a reason for hiding this comment

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

Thank you!

@dosubot dosubot bot added the lgtm PRs that are ready to be merged as-is label Nov 25, 2024
@jacoblee93 jacoblee93 merged commit 53d8ff5 into langchain-ai:main Nov 25, 2024
32 checks passed
@shan-mx shan-mx deleted the fix/prisma-in-operator-empty-array branch November 27, 2024 04:12
FilipZmijewski pushed a commit to FilipZmijewski/langchainjs that referenced this pull request Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:bug Related to a bug, vulnerability, unexpected error with an existing feature lgtm PRs that are ready to be merged as-is size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants