diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-02-11 14:05:49 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-02-11 18:25:52 -0500 |
commit | 553ac45aae5712e64a5380ba1fa1c6028acf5f39 (patch) | |
tree | 1a165d582d7bfc1fb78f485f31f8b26d9a35eb10 /lib/sqlalchemy/sql/elements.py | |
parent | 89dc4562adb38367ee5fabbcc04ee44968af4906 (diff) | |
download | sqlalchemy-553ac45aae5712e64a5380ba1fa1c6028acf5f39.tar.gz |
Apply consistent labeling for all future style ORM queries
Fixed issue in new 1.4/2.0 style ORM queries where a statement-level label
style would not be preserved in the keys used by result rows; this has been
applied to all combinations of Core/ORM columns / session vs. connection
etc. so that the linkage from statement to result row is the same in all
cases.
also repairs a cache key bug where query.from_statement()
vs. select().from_statement() would not be disambiguated; the
compile options were not included in the cache key for
FromStatement.
Fixes: #5933
Change-Id: I22f6cf0f0b3360e55299cdcb2452cead2b2458ea
Diffstat (limited to 'lib/sqlalchemy/sql/elements.py')
-rw-r--r-- | lib/sqlalchemy/sql/elements.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index c6eae739d..2bd1c3ae3 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -3720,6 +3720,9 @@ class Grouping(GroupedElement, ColumnElement): def _key_label(self): return self._label + def _gen_label(self, name): + return name + @property def _label(self): return getattr(self.element, "_label", None) or self.anon_label |