| 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 | |
| 809 | class Compiled: |