MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / warn

Method warn

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

Source from the content-addressed store, hash-verified

782 return None, None
783
784 def warn(self, stmt_type="SELECT"):
785 the_rest, start_with = self.lint()
786
787 # FROMS left over? boom
788 if the_rest:
789 froms = the_rest
790 if froms:
791 template = (
792 "{stmt_type} statement has a cartesian product between "
793 "FROM element(s) {froms} and "
794 'FROM element "{start}". Apply join condition(s) '
795 "between each element to resolve."
796 )
797 froms_str = ", ".join(
798 f'"{self.froms[from_]}"' for from_ in froms
799 )
800 message = template.format(
801 stmt_type=stmt_type,
802 froms=froms_str,
803 start=self.froms[start_with],
804 )
805
806 util.warn(message)
807
808
809class Compiled:

Callers 15

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

Calls 2

lintMethod · 0.95
joinMethod · 0.45

Tested by 1