Skip to content

Commit

Permalink
Merge "stdlib: Disable JOINID validation" into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Treehugger Robot authored and Gerrit Code Review committed Dec 2, 2024
2 parents d7af572 + 9743f83 commit 21dcdf3
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions tools/check_sql_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ def main():
f"{len(parsed.table_views)} tables/views, "
f"{len(parsed.macros)} macros.")

tables_with_id_cols = {}
for _, _, m in modules:
tables_with_id_cols.update(m.id_columns)

all_errors = 0
for path, sql, parsed in modules:
errors = []
Expand Down Expand Up @@ -130,22 +126,6 @@ def main():
f"Modules from package 'android' can't include '{include.module}' "
f"from package 'chrome'")

# Validate JOINID type.
# Verify if the JOINID references an ID column of a table.
for o in parsed.table_views:
for c, arg in o.joinid_cols.items():
[tab, id_col] = arg.joinid_column.split('.')
if tab not in tables_with_id_cols.keys():
errors.append(
f"JOINID column '{c}' of '{o.name}' references table '{tab}' that doesn't exist."
)
continue
if id_col not in tables_with_id_cols[tab]:
errors.append(
f"JOINID column '{c}' of '{o.name}' references ID column '{id_col}' in '{tab}' that doesn't exist."
)
continue

errors += [
*parsed.errors, *check_banned_words(sql),
*check_banned_create_table_as(sql), *check_banned_create_view_as(sql),
Expand Down

0 comments on commit 21dcdf3

Please sign in to comment.