]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
do not use LABEL_STYLE_TABLENAME_PLUS_COL in session.get()
authorInada Naoki <songofacandy@gmail.com>
Wed, 15 Oct 2025 11:18:45 +0000 (20:18 +0900)
committerInada Naoki <songofacandy@gmail.com>
Thu, 16 Oct 2025 04:57:22 +0000 (13:57 +0900)
lib/sqlalchemy/orm/session.py

index 100ef84fde0a97ed75cc5799ed2c57d3a351d8e5..56b690aa4be6c7bcb5d1f879238231ba21ee5b3a 100644 (file)
@@ -89,7 +89,6 @@ from ..sql.base import _NoArg
 from ..sql.base import CompileState
 from ..sql.schema import Table
 from ..sql.selectable import ForUpdateArg
-from ..sql.selectable import LABEL_STYLE_TABLENAME_PLUS_COL
 from ..util import deprecated_params
 from ..util import IdentitySet
 from ..util.typing import TupleAny
@@ -3903,17 +3902,11 @@ class Session(_SessionClassMethods, EventTarget):
             # TODO: this was being tested before, but this is not possible
             assert instance is not LoaderCallableStatus.PASSIVE_CLASS_MISMATCH
 
-        # set_label_style() not strictly necessary, however this will ensure
-        # that tablename_colname style is used which at the moment is
-        # asserted in a lot of unit tests :)
-
         load_options = context.QueryContext.default_load_options
 
         if populate_existing:
             load_options += {"_populate_existing": populate_existing}
-        statement = sql.select(mapper).set_label_style(
-            LABEL_STYLE_TABLENAME_PLUS_COL
-        )
+        statement = sql.select(mapper)
         if with_for_update is not None:
             statement._for_update_arg = ForUpdateArg._from_argument(
                 with_for_update