From 8f126a3bf3ddbfd9753159be59e51a454d91c7a0 Mon Sep 17 00:00:00 2001 From: Kilian Helfenbein Date: Wed, 12 Feb 2025 15:53:20 +0100 Subject: [PATCH] use provided engine in config.py --- edisgo/tools/config.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/edisgo/tools/config.py b/edisgo/tools/config.py index 1b1a681d..6cf74c77 100644 --- a/edisgo/tools/config.py +++ b/edisgo/tools/config.py @@ -187,20 +187,16 @@ def get_database_alias_dictionaries(self) -> tuple[dict[str, str], dict[str, str - schema_mapping: A dictionary mapping source schema names to target schema names. """ - OEP_CONNECTION = "postgresql+oedialect://:@{platform}" - platform = "toep.iks.cs.ovgu.de" - conn_str = OEP_CONNECTION.format(platform=platform) - engine = sa.create_engine(conn_str) dictionary_schema_name = ( "model_draft" # Replace with the actual schema name if needed ) dictionary_module_name = f"saio.{dictionary_schema_name}" - register_schema(dictionary_schema_name, engine) + register_schema(dictionary_schema_name, self._engine) dictionary_table_name = "edut_00" dictionary_table = importlib.import_module(dictionary_module_name).__getattr__( dictionary_table_name ) - with session_scope_egon_data(engine) as session: + with session_scope_egon_data(self._engine) as session: query = session.query(dictionary_table) dictionary_entries = query.all() name_mapping = {