Skip to content

fix(v2): quote identifiers in adelete and metadata filters#302

Open
naveen9871 wants to merge 2 commits into
langchain-ai:mainfrom
naveen9871:fix/v2-unquoted-identifiers
Open

fix(v2): quote identifiers in adelete and metadata filters#302
naveen9871 wants to merge 2 commits into
langchain-ai:mainfrom
naveen9871:fix/v2-unquoted-identifiers

Conversation

@naveen9871

Copy link
Copy Markdown

Fixes #301

@dishaprakash

Copy link
Copy Markdown
Collaborator

naveen9871 Could you please add test cases for this fix?

Add tests/unit_tests/v2/test_identifier_quoting.py covering:

Offline SQL-generation tests (no DB required):
- TestAdeleteQuotingOffline: verifies adelete WHERE clause double-quotes
  the id_column for mixed-case, spaced, and reserved-word names
- TestFilterClauseQuotingOffline: verifies _create_filter_clause
  double-quotes both the metadata JSON column and explicit metadata
  columns, including nested JSON paths

Integration tests (require PostgreSQL):
- TestIdentifierQuotingIntegration: end-to-end regression tests that
  create tables with mixed-case column names and confirm adelete and
  similarity_search with metadata filters work without SQL errors
@naveen9871

Copy link
Copy Markdown
Author

Thanks for the review! I've added unit tests covering the identifier quoting fix in the latest commit (e5d87f8). Please let me know if you'd like me to add any additional test scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: v2 AsyncPGVectorStore fails with mixed-case column names due to unquoted identifiers in adelete and filters

2 participants