From 742c3398b362c8b9d2f2a70058247ee5552d1585 Mon Sep 17 00:00:00 2001 From: Monique Rio Date: Tue, 24 Sep 2024 20:41:39 +0000 Subject: [PATCH] change mysql_database url creation --- aim/services.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/aim/services.py b/aim/services.py index a55d52d..b3dffdc 100644 --- a/aim/services.py +++ b/aim/services.py @@ -1,7 +1,14 @@ from types import SimpleNamespace import os +import sqlalchemy as sa S = SimpleNamespace() -S.mysql_database = f'mysql+mysqldb://{os.environ["MARIADB_USER"]}:{os.environ["MARIADB_PASSWORD"]}@{os.environ["DATABASE_HOST"]}/{os.environ["MARIADB_DATABASE"]}' +S.mysql_database = sa.engine.URL.create( + drivername="mysql+mysqldb", + username=os.environ["MARIADB_USER"], + password=os.environ["MARIADB_PASSWORD"], + host=os.environ["DATABASE_HOST"], + database=os.environ["MARIADB_DATABASE"], +) S.test_database = "sqlite:///:memory:" S.ci_on = os.getenv("CI")