diff --git a/bigquery_etl/cli/utils.py b/bigquery_etl/cli/utils.py index 41b106ad64b..ab5cb58ba78 100644 --- a/bigquery_etl/cli/utils.py +++ b/bigquery_etl/cli/utils.py @@ -87,13 +87,14 @@ def paths_matching_checks_pattern( pattern, sql_path, project_id, ["checks.sql"], CHECKS_FILE_RE ) - for checks_file in checks_files: - match = CHECKS_FILE_RE.match(str(checks_file)) - if match: - project = match.group(1) - dataset = match.group(2) - table = match.group(3) - yield checks_file, project, dataset, table + if checks_files: + for checks_file in checks_files: + match = CHECKS_FILE_RE.match(str(checks_file)) + if match: + project = match.group(1) + dataset = match.group(2) + table = match.group(3) + yield checks_file, project, dataset, table else: print(f"No checks.sql file found in {sql_path}/{project_id}/{pattern}") diff --git a/sql/moz-fx-data-shared-prod/mozilla_org_derived/ga_sessions_v1/checks.sql b/sql/moz-fx-data-shared-prod/mozilla_org_derived/ga_sessions_v1/checks.sql index 2267d81bbe6..e378472e0a9 100644 --- a/sql/moz-fx-data-shared-prod/mozilla_org_derived/ga_sessions_v1/checks.sql +++ b/sql/moz-fx-data-shared-prod/mozilla_org_derived/ga_sessions_v1/checks.sql @@ -1,7 +1,7 @@ #fail -- ga_session_id should be unique across all partitions -{{ is_unique(["ga_session_id"]) }} +{{ is_unique(["ga_session_id"], "session_date = @session_date") }} #fail -{{ min_row_count(10000) }} +{{ min_row_count(100, "session_date = @session_date") }}