From 85da2cc26f128461d1363f0871a75b29d871a53f Mon Sep 17 00:00:00 2001 From: martynia Date: Thu, 31 Oct 2024 15:01:21 +0100 Subject: [PATCH] fix: fix select statement, remove unnecessary code in testing/__init__() --- .../src/diracx/routers/pilot_logging/remote_logger.py | 4 ++-- diracx-testing/src/diracx/testing/__init__.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/diracx-routers/src/diracx/routers/pilot_logging/remote_logger.py b/diracx-routers/src/diracx/routers/pilot_logging/remote_logger.py index 1c51cbfd..418f8d39 100644 --- a/diracx-routers/src/diracx/routers/pilot_logging/remote_logger.py +++ b/diracx-routers/src/diracx/routers/pilot_logging/remote_logger.py @@ -41,8 +41,8 @@ async def send_message( async with db.engine_context(): async with db: - stmt = select( - (PilotAgents.PilotID).where(PilotAgents.PilotStamp == data.pilot_stamp) + stmt = select(PilotAgents.PilotID).where( + PilotAgents.PilotStamp == data.pilot_stamp ) pilot_id = (await db.conn.execute(stmt)).scalar_one() diff --git a/diracx-testing/src/diracx/testing/__init__.py b/diracx-testing/src/diracx/testing/__init__.py index e3afddb4..6ced3e77 100644 --- a/diracx-testing/src/diracx/testing/__init__.py +++ b/diracx-testing/src/diracx/testing/__init__.py @@ -211,8 +211,7 @@ def enrich_tokens(access_payload: dict, refresh_payload: dict): test_dev_settings, ], database_urls=database_urls, - os_database_conn_kwargs=os_database_conn_kwargs - | {"PilotLogsDB": {"sqlalchemy_dsn": "sqlite+aiosqlite:///:memory:"}}, + os_database_conn_kwargs=os_database_conn_kwargs, config_source=ConfigSource.create_from_url( backend_url=f"git+file://{with_config_repo}" ),