Skip to content

Fix for vector extension order #117

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

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.envFile": "",
"files.exclude": {
".ruff_cache": true,
".pytest_cache": true,
Expand Down
5 changes: 4 additions & 1 deletion src/backend/fastapi_app/postgres_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ def get_password_from_azure_credential():
@event.listens_for(engine.sync_engine, "connect")
def register_custom_types(dbapi_connection: AdaptedConnection, *args):
logger.info("Registering pgvector extension...")
dbapi_connection.run_async(register_vector)
try:
dbapi_connection.run_async(register_vector)
except ValueError:
logger.warning("Could not register pgvector data type yet as vector extension has not been CREATEd")

@event.listens_for(engine.sync_engine, "do_connect")
def update_password_token(dialect, conn_rec, cargs, cparams):
Expand Down
Loading