From 0acf625f908ef05a8fa221d8a5fec3d14e09810c Mon Sep 17 00:00:00 2001 From: John Davis Date: Thu, 9 Jan 2025 11:54:20 -0500 Subject: [PATCH] Remove commented out block, edit comment --- lib/galaxy/model/base.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/galaxy/model/base.py b/lib/galaxy/model/base.py index e7e2c53e6f11..2dd49b468ec5 100644 --- a/lib/galaxy/model/base.py +++ b/lib/galaxy/model/base.py @@ -44,6 +44,7 @@ @contextlib.contextmanager def transaction(session: Union[scoped_session, Session, "SessionlessContext"]): """Start a new transaction only if one is not present.""" + # TODO The `session.begin` code has been removed. Once we can verify this does not break SQLAlchemy transactions, remove this helper + all references (561) # temporary hack; need to fix access to scoped_session callable, not proxy if isinstance(session, scoped_session): session = session() @@ -52,12 +53,7 @@ def transaction(session: Union[scoped_session, Session, "SessionlessContext"]): yield return # exit: can't use as a Session - yield # TODO once we can verify this does not break SQLAlchemy transactions, remove this helper completely (561 instances) - # if not session.in_transaction(): # type:ignore[union-attr] - # with session.begin(): # type:ignore[union-attr] - # yield - # else: - # yield + yield def check_database_connection(session):