MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / warn

Method warn

lib/sqlalchemy/sql/compiler.py:750–772  ·  view source on GitHub ↗
(self, stmt_type="SELECT")

Source from the content-addressed store, hash-verified

748 return None, None
749
750 def warn(self, stmt_type="SELECT"):
751 the_rest, start_with = self.lint()
752
753 # FROMS left over? boom
754 if the_rest:
755 froms = the_rest
756 if froms:
757 template = (
758 "{stmt_type} statement has a cartesian product between "
759 "FROM element(s) {froms} and "
760 'FROM element "{start}". Apply join condition(s) '
761 "between each element to resolve."
762 )
763 froms_str = ", ".join(
764 f'"{self.froms[from_]}"' for from_ in froms
765 )
766 message = template.format(
767 stmt_type=stmt_type,
768 froms=froms_str,
769 start=self.froms[start_with],
770 )
771
772 util.warn(message)
773
774
775class Compiled:

Callers 15

_compose_select_bodyMethod · 0.95
visit_updateMethod · 0.95
visit_deleteMethod · 0.95
_reflect_typeMethod · 0.45
__init__Method · 0.45
returning_clauseMethod · 0.45
get_multi_columnsMethod · 0.45
do_rollbackMethod · 0.45

Calls 2

lintMethod · 0.95
joinMethod · 0.45

Tested by 1