Skip to content
Merged
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
6 changes: 5 additions & 1 deletion lambda_function/src/file_processor/file_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,12 @@ def _track_file_metatracker(
client = session.client(service_name="secretsmanager")
response = client.get_secret_value(SecretId=secret_arn)
secret = json.loads(response["SecretString"])
# Name the DBAPI explicitly. SQLAlchemy 2.1 made psycopg (v3) the
# default driver for plain "postgresql://" URLs, but this image
# installs psycopg2-binary, so a bare scheme fails with
# "No module named 'psycopg'" and the file is never tracked.
connection_string = (
f"postgresql://{secret['username']}:{secret['password']}@"
f"postgresql+psycopg2://{secret['username']}:{secret['password']}@"
f"{secret['host']}:{secret['port']}/{secret['dbname']}"
)

Expand Down
Loading