--- /dev/null
+.. change::
+ :tags: bug, orm
+ :tickets: 12357
+
+ Fixed issue where the "is ORM" flag of a :func:`.select` or other ORM
+ statement would not be propagated to the ORM :class:`.Session` based on a
+ multi-part operator expression alone, e.g. such as ``Cls.attr + Cls.attr +
+ Cls.attr`` or similar, leading to ORM behaviors not taking place for such
+ statements.
def propagate_cases():
return testing.combinations(
(lambda: select(1), False),
+ (lambda User: select(User.id), True),
+ (lambda User: select(User.id + User.id), True),
+ (lambda User: select(User.id + User.id + User.id), True),
+ (lambda User: select(sum([User.id] * 10, User.id)), True), # type: ignore # noqa: E501
+ (
+ lambda User: select(literal_column("3") + User.id + User.id),
+ True,
+ ),
(lambda User: select(func.count(User.id)), True),
(
lambda User: select(1).select_from(select(User).subquery()),