diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-02-05 13:38:28 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-02-05 13:54:37 -0500 |
| commit | bc9221bf781adfffdddf12860d4eed7650457a0a (patch) | |
| tree | 83992d60fb056610cd29660a71a0284b74150785 /lib/sqlalchemy/testing/assertions.py | |
| parent | ac1228a87290aca4aa64cec27e640817be932feb (diff) | |
| download | sqlalchemy-bc9221bf781adfffdddf12860d4eed7650457a0a.tar.gz | |
Track a second from_linter for lateral subqueries
Fixed bug where the "cartesian product" assertion was not correctly
accommodating for joins between tables that relied upon the use of LATERAL
to connect from a subquery to another subquery in the enclosing context.
Additionally, enabled from_linting for the base assert_compile(),
however it remains off by default; to enable by default we would
have to make sure it isn't set for DDL compiles and there's also
a lot of tests that would also need to turn it off, so leaving
this off for expediency.
Fixes: #5924
Change-Id: I22604baf572f8c4d96befcc610b3dcb79c13fc4a
Diffstat (limited to 'lib/sqlalchemy/testing/assertions.py')
| -rw-r--r-- | lib/sqlalchemy/testing/assertions.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py index 79125e1f1..44d7405b1 100644 --- a/lib/sqlalchemy/testing/assertions.py +++ b/lib/sqlalchemy/testing/assertions.py @@ -394,6 +394,7 @@ class AssertsCompiledSQL(object): schema_translate_map=None, render_schema_translate=False, default_schema_name=None, + from_linting=False, ): if use_default_dialect: dialect = default.DefaultDialect() @@ -438,6 +439,9 @@ class AssertsCompiledSQL(object): if render_schema_translate: kw["render_schema_translate"] = True + if from_linting or getattr(self, "assert_from_linting", False): + kw["linting"] = sql.FROM_LINTING + from sqlalchemy import orm if isinstance(clause, orm.dynamic.AppenderQuery): |
