diff options
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
| -rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 4bd19e04b..f4160b552 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -2829,10 +2829,12 @@ class SQLCompiler(Compiled): if self.linting & COLLECT_CARTESIAN_PRODUCTS: from_linter = FromLinter({}, set()) + warn_linting = self.linting & WARN_LINTING if toplevel: self.from_linter = from_linter else: from_linter = None + warn_linting = False if froms: text += " \nFROM " @@ -2872,10 +2874,7 @@ class SQLCompiler(Compiled): if t: text += " \nWHERE " + t - if ( - self.linting & COLLECT_CARTESIAN_PRODUCTS - and self.linting & WARN_LINTING - ): + if warn_linting: from_linter.warn() if select._group_by_clauses: |
