summaryrefslogtreecommitdiff
path: root/test/sql/test_selectable.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-02-11 14:05:49 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2021-02-12 18:58:53 -0500
commit1d2b49bc991ca866fd71da3ccfbcde5093482512 (patch)
tree45d83e2a1ae0b4356670f2600e8f3b34d0776911 /test/sql/test_selectable.py
parent4aa0c7ae76894048c5c30c89c403c7cbf5d844ff (diff)
downloadsqlalchemy-1d2b49bc991ca866fd71da3ccfbcde5093482512.tar.gz
Further refine labeling for renamed columns
Forked from I22f6cf0f0b3360e55299cdcb2452cead2b2458ea we are attempting to decide the case for columns mapped under a different name. since the .key feature of Column seems to support this fully, see if an annotation can be used to indicate an effective .key for a column. The effective change is that the labeling of column expressions in rows has been improved to retain the original name of the ORM attribute even if used in a subquery. References: #5933 Change-Id: If251f556f7d723f50d349f765f1690d6c679d2ef
Diffstat (limited to 'test/sql/test_selectable.py')
-rw-r--r--test/sql/test_selectable.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py
index e15c74075..9f0c72247 100644
--- a/test/sql/test_selectable.py
+++ b/test/sql/test_selectable.py
@@ -3067,11 +3067,11 @@ class WithLabelsTest(fixtures.TestBase):
)
eq_(
list(sel.selected_columns.keys()),
- ["t_x_id", "t_x_b_1"],
+ ["t_x_id", "t_x_id_1"],
)
eq_(
list(sel.subquery().c.keys()),
- ["t_x_id", "t_x_b_1"],
+ ["t_x_id", "t_x_id_1"],
)
self._assert_result_keys(sel, ["t_a", "t_x_b"])
self._assert_subq_result_keys(sel, ["t_a", "t_x_b"])
@@ -3095,11 +3095,11 @@ class WithLabelsTest(fixtures.TestBase):
)
eq_(
list(sel.selected_columns.keys()),
- ["t_x_a", "t_x_id_1"],
+ ["t_x_a", "t_x_a_1"],
)
# deduping for different cols but same label
- eq_(list(sel.subquery().c.keys()), ["t_x_a", "t_x_id_1"])
+ eq_(list(sel.subquery().c.keys()), ["t_x_a", "t_x_a_1"])
# if we turn off deduping entirely
# eq_(list(sel.subquery().c.keys()), ["t_x_a", "t_x_a"])
@@ -3115,7 +3115,7 @@ class WithLabelsTest(fixtures.TestBase):
def test_keys_overlap_names_dont_nolabel(self):
sel = self._keys_overlap_names_dont()
- eq_(sel.selected_columns.keys(), ["x", "b_1"])
+ eq_(sel.selected_columns.keys(), ["x", "x_1"])
self._assert_result_keys(sel, ["a", "b"])
def test_keys_overlap_names_dont_label(self):