Skip to content

This commit provides a robust fix for a recurring database connection…

Created by: Edouard-Legoupil

… issue in the 2-update_embeddings.py script.

The script was previously failing with a psycopg2.OperationalError when the database password contained special characters. This was because the connection string was being constructed in a way that did not properly escape these characters, causing the URL parser to fail.

The fix involves using SQLAlchemy's URL.create method to build the database connection string. This method correctly handles URL encoding for all components, including the username and password, making the connection resilient to special characters. The host and port have also been correctly set to "localhost" and "5432" to ensure a reliable connection through the Cloud SQL Proxy.

  • Does my code meet the quality standards for releasing packages?
  • Does the reviewer have all the information to validate the features/issues without too much research?
  • Does the customer who will validate the associated tickets have the information to do so without wasting time?

Issues to validate to close :

  • issue #

Processed issues to keep open or in progress:

  • issue #

Checklist:

  • Does the package check go local?
  • Does the CI pass?
  • Are the added / fixed features documented, tested?
  • Are the added features / solved problems briefly presented in the PR message?
  • Are the changes related to tickets / issues that I have listed in the commits and in the PR itself?
  • Are the tickets in "review" mode in the Project Tracking Board?
  • Does each ticket, if it is to be closed after acceptance of the PR, contain a comment that tells how to validate it?

Merge request reports

Loading