Skip to content

Conversation

@bp1183
Copy link
Collaborator

@bp1183 bp1183 commented Apr 30, 2025

🦋 Bug Fix

PR Description

The class PGVectorQuery in components/embeddings.py takes an open SQLAlchemy connection.
Best practice is to open and close these connections as needed for given hit of the database.
I have removed this as a constructor parameter connection and instead used the get_session context manager from db_manager within the run method of PGVectorQuery.

Related Issues or other material

Related #
Closes #

✅ Added/updated tests?

  • [] This PR contains relevant tests
  • [] Added tests/integration/test_embeddings_db.py file with a couple of initial tests for the PGVectorQuery class and Embeddings class

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.

2 participants