Skip to content

fix: dangling db connection in pgvectorquery - #136

Merged
bp1183 merged 11 commits into
mainfrom
bugfix/fix-dangling-db-connection-in-pgvectorquery
Sep 22, 2026
Merged

bp1183 merged 11 commits into
mainfrom
bugfix/fix-dangling-db-connection-in-pgvectorquery

Conversation

@bp1183

@bp1183 bp1183 commented Apr 30, 2025

Copy link
Copy Markdown
Collaborator
🦋 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

@kuraisle kuraisle changed the title Bugfix/fix dangling db connection in pgvectorquery fix: dangling db connection in pgvectorquery Sep 22, 2026
@bp1183
bp1183 marked this pull request as ready for review September 22, 2026 14:25
@bp1183
bp1183 merged commit d76d353 into main Sep 22, 2026
7 checks passed
@bp1183
bp1183 deleted the bugfix/fix-dangling-db-connection-in-pgvectorquery branch September 22, 2026 14:36
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.1.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants