diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-06-01 12:11:19 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-06-01 12:11:19 -0400 |
commit | 14250f2668151f1c4df86dbf962c771e9788111e (patch) | |
tree | 8a603f0cb5f80edbbadfa8b48fdd5636d4cbba26 /lib/sqlalchemy/sql/elements.py | |
parent | 79dbe94bb4ccd75888d57f388195a3ba4fa6117e (diff) | |
download | sqlalchemy-14250f2668151f1c4df86dbf962c771e9788111e.tar.gz |
propagate proxy_key from WrapsColumnExpression
this allows cast() of a label() to propagate the
proxy key outwards in the same way that it apparently
works at the SQL level.
This is stuffing even more rules into naming so basically
seeing how far we can go without other cases starting
to fail.
Fixes: #8084
Change-Id: I20bd97dae798fee6492334c06934e807d0f269ef
Diffstat (limited to 'lib/sqlalchemy/sql/elements.py')
-rw-r--r-- | lib/sqlalchemy/sql/elements.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index 61c5379d8..f9ede8a71 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -1768,6 +1768,14 @@ class WrapsColumnExpression(ColumnElement[_T]): else: return self._dedupe_anon_tq_label_idx(idx) + @property + def _proxy_key(self): + wce = self.wrapped_column_expression + + if not wce._is_text_clause: + return wce._proxy_key + return super()._proxy_key + SelfBindParameter = TypeVar("SelfBindParameter", bound="BindParameter[Any]") |