diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-09-16 18:46:53 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-09-16 18:46:53 -0400 |
commit | 24a7241b5ef63f8e82c007d89f5c179d9596bf10 (patch) | |
tree | 00238ad56de2b15ac11df8e333de1e98e5386cab /test/sql/test_compiler.py | |
parent | 7eb34baf99179eec966ddd8b3607a6d8cfdfba21 (diff) | |
download | sqlalchemy-24a7241b5ef63f8e82c007d89f5c179d9596bf10.tar.gz |
- The :func:`.type_coerce` construct is now a fully fledged Core
expression element which is late-evaluated at compile time. Previously,
the function was only a conversion function which would handle different
expression inputs by returning either a :class:`.Label` of a column-oriented
expression or a copy of a given :class:`.BindParameter` object,
which in particular prevented the operation from being logically
maintained when an ORM-level expression transformation would convert
a column to a bound parameter (e.g. for lazy loading).
fixes #3531
Diffstat (limited to 'test/sql/test_compiler.py')
-rw-r--r-- | test/sql/test_compiler.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py index 7ff7d68af..c957b2f8a 100644 --- a/test/sql/test_compiler.py +++ b/test/sql/test_compiler.py @@ -3484,13 +3484,15 @@ class ResultMapTest(fixtures.TestBase): tc = type_coerce(t.c.a, String) stmt = select([t.c.a, l1, tc]) comp = stmt.compile() - tc_anon_label = comp._create_result_map()['a_1'][1][0] + tc_anon_label = comp._create_result_map()['anon_1'][1][0] eq_( comp._create_result_map(), { 'a': ('a', (t.c.a, 'a', 'a'), t.c.a.type), 'bar': ('bar', (l1, 'bar'), l1.type), - 'a_1': ('%%(%d a)s' % id(tc), (tc_anon_label, 'a_1'), tc.type), + 'anon_1': ( + '%%(%d anon)s' % id(tc), + (tc_anon_label, 'anon_1', tc), tc.type), }, ) |