From a1d02500901c2c8364a6907e1b934178256b62ab Mon Sep 17 00:00:00 2001 From: ErnestaP Date: Fri, 2 Aug 2024 12:10:43 +0200 Subject: [PATCH] Operators: refactoring --- dags/common/operators/sqlalchemy_operator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dags/common/operators/sqlalchemy_operator.py b/dags/common/operators/sqlalchemy_operator.py index a247b02..355388b 100644 --- a/dags/common/operators/sqlalchemy_operator.py +++ b/dags/common/operators/sqlalchemy_operator.py @@ -14,7 +14,7 @@ def get_session(conn_id: str): def sqlalchemy_task(conn_id: str): def decorator(func): @task(executor_config=kubernetes_executor_config) - def wrapper(*args, **kwargs): + def populate_database(*args, **kwargs): session = get_session(conn_id) try: result = func(*args, session=session, **kwargs) @@ -26,6 +26,6 @@ def wrapper(*args, **kwargs): finally: session.close() - return wrapper + return populate_database return decorator