diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-04-02 11:06:28 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-04-02 11:08:10 -0400 |
| commit | a16687b3fc4179e8f42d8099aa6d1e6d18fedf70 (patch) | |
| tree | 562b2f5b7875abd28cbcc014cadbfa810b3a7bb5 /lib/sqlalchemy/sql | |
| parent | ba3e6860930b88f6c704250ccc711eb6965d0da0 (diff) | |
| download | sqlalchemy-a16687b3fc4179e8f42d8099aa6d1e6d18fedf70.tar.gz | |
Ensure Grouping._with_binary_element_type() maintains class
Fixed regression where use of the :meth:`.Operators.in_` method with a
:class:`_sql.Select` object against a non-table-bound column would produce
an ``AttributeError``, or more generally using a :class:`_sql.ScalarSelect`
that has no datatype in a binary expression would produce invalid state.
Fixes: #6181
Change-Id: I1ddea433b3603fdab8f489bff571b512a6ffc66b
Diffstat (limited to 'lib/sqlalchemy/sql')
| -rw-r--r-- | lib/sqlalchemy/sql/elements.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index 7a27690b8..c48338303 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -3764,7 +3764,7 @@ class Grouping(GroupedElement, ColumnElement): self.type = getattr(element, "type", type_api.NULLTYPE) def _with_binary_element_type(self, type_): - return Grouping(self.element._with_binary_element_type(type_)) + return self.__class__(self.element._with_binary_element_type(type_)) @util.memoized_property def _is_implicitly_boolean(self): |
