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

Broaden SQLAlchemy support in llama-index-vector-stores-postgres to 1.4+ #13936

Merged
merged 4 commits into from
Jun 6, 2024

Conversation

jamesoc-eiq
Copy link
Contributor

Description

llama-index-vector-stores-postgres currently has a dependency on SQLALchemy 2.0.
However, there is a large body of existing code written for SQLAlchemy 1.4.x, which is still maintained and in active use.
This PR allows llama-index-vector-stores-postgres to be used with both versions, making is vastly easier to integrate into existing codebases. It also harmonises the repo with llama-index-core which currently depends on 1.4.49.
Added input validation for schema_name to allow safe usage of format string instead of an SQL param for schema creation.

Type of Change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Re-ran existing tests, all passed with 100% pass rate, using a pgvector/pgvector:pg14 docker container as back-end:
docker run -d \
  --name pgvector_container \
  -e POSTGRES_PASSWORD=mark90 \
  -p 5432:5432 \
  pgvector/pgvector:pg14
  • 100% passing tests for both SQLAlchemy 1.4.49 and 2.0.25
  • I stared at the code and made sure it makes sense

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings (existing, unrelated deprecation warnings have been suppressed for clarity
  • New and existing unit tests pass locally with my changes
  • I ran make format; make lint to appease the lint gods

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jun 4, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 6, 2024
@logan-markewich logan-markewich enabled auto-merge (squash) June 6, 2024 15:38
@logan-markewich logan-markewich merged commit e1b9f31 into run-llama:main Jun 6, 2024
8 checks passed
Mateusz-Switala pushed a commit to Mateusz-Switala/llama_index that referenced this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants