]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
don't use LABEL_STYLE_TABLENAME_PLUS_COL on _load_on_ident()
authorInada Naoki <songofacandy@gmail.com>
Tue, 21 Oct 2025 12:07:55 +0000 (21:07 +0900)
committerInada Naoki <songofacandy@gmail.com>
Tue, 21 Oct 2025 12:07:55 +0000 (21:07 +0900)
lib/sqlalchemy/orm/persistence.py
test/orm/test_unitofworkv2.py

index f720f90951a1ea9dd4fced660bdf0528f24ff6a6..da6d053fbb7ffb0fbb115e66a9b61cdb2d8b8c79 100644 (file)
@@ -34,7 +34,6 @@ from .. import util
 from ..engine import cursor as _cursor
 from ..sql import operators
 from ..sql.elements import BooleanClauseList
-from ..sql.selectable import LABEL_STYLE_TABLENAME_PLUS_COL
 
 
 def _save_obj(base_mapper, states, uowtransaction, single=False):
@@ -1559,9 +1558,7 @@ def _finalize_insert_update_commands(base_mapper, uowtransaction, states):
 
         if toload_now:
             state.key = base_mapper._identity_key_from_state(state)
-            stmt = future.select(mapper).set_label_style(
-                LABEL_STYLE_TABLENAME_PLUS_COL
-            )
+            stmt = future.select(mapper)
             loading._load_on_ident(
                 uowtransaction.session,
                 stmt,
index 0a99bca9620c61a27dbc4191bdda7249d765ec18..1e981c360d96901b56fa4eab382b34d10b2484f5 100644 (file)
@@ -3253,12 +3253,12 @@ class EagerDefaultsSettingTest(
                         expected_eager_defaults and not expect_returning,
                         [
                             CompiledSQL(
-                                "SELECT test.foo AS test_foo "
+                                "SELECT test.foo "
                                 "FROM test WHERE test.id = :pk_1",
                                 [{"pk_1": 1}],
                             ),
                             CompiledSQL(
-                                "SELECT test.foo AS test_foo "
+                                "SELECT test.foo "
                                 "FROM test WHERE test.id = :pk_1",
                                 [{"pk_1": 2}],
                             ),
@@ -3373,12 +3373,12 @@ class EagerDefaultsSettingTest(
                         expected_eager_defaults and not expect_returning,
                         [
                             CompiledSQL(
-                                "SELECT test.foo AS test_foo "
+                                "SELECT test.foo "
                                 "FROM test WHERE test.id = :pk_1",
                                 [{"pk_1": 1}],
                             ),
                             CompiledSQL(
-                                "SELECT test.foo AS test_foo "
+                                "SELECT test.foo "
                                 "FROM test WHERE test.id = :pk_1",
                                 [{"pk_1": 2}],
                             ),
@@ -3449,12 +3449,12 @@ class EagerDefaultsSettingTest(
                                 ],
                             ),
                             CompiledSQL(
-                                "SELECT test.bar AS test_bar "
+                                "SELECT test.bar "
                                 "FROM test WHERE test.id = :pk_1",
                                 [{"pk_1": 1}],
                             ),
                             CompiledSQL(
-                                "SELECT test.bar AS test_bar "
+                                "SELECT test.bar "
                                 "FROM test WHERE test.id = :pk_1",
                                 [{"pk_1": 2}],
                             ),