Skip to content

Commit

Permalink
Migrated DIM checks over to ETL checks for internet_outages.global_ou…
Browse files Browse the repository at this point in the history
…tages_v1
  • Loading branch information
kik-kik committed Dec 1, 2023
1 parent 9409d2b commit d9b97fe
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#fail
{{ min_row_count(1000, where="DATE(datetime) = @submission_date") }}

#fail
{{ is_unique(columns=["datetime", "city", "country"], where="DATE(`datetime`) = @submission_date") }}

#fail
{{ not_null(columns=[
"datetime",
"city",
"country",
"proportion_undefined",
"proportion_timeout",
"proportion_abort",
"proportion_unreachable",
"proportion_terminated",
"proportion_channel_open",
"avg_dns_success_time",
"missing_dns_success",
"avg_dns_failure_time",
"missing_dns_failure",
"count_dns_failure",
"ssl_error_prop",
"avg_tls_handshake_time"

], where="DATE(`datetime`) = @submission_date") }}

#fail
SELECT IF(
COUNTIF(LENGTH(country) <> 2) > 0,
ERROR("Some values in this field do not adhere to the ISO 3166-1 specification (2 character country code)."),
null
)
FROM `{{ project_id }}.{{ dataset_id }}.{{ table_name }}`
WHERE DATE(`datetime`) = @submission_date

0 comments on commit d9b97fe

Please sign in to comment.