-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjusted verification query for polling trigger (#24)
* fix and check last_modified * fix condition * fix partitions * update dataform sources * referencing tables * lint * format * descriptive asserts * simplified trigger query * explanatory message
- Loading branch information
1 parent
9a19a56
commit 5f52ce3
Showing
4 changed files
with
66 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const database = 'chrome-ux-report' | ||
|
||
const pastMonth = constants.fnPastMonth(constants.currentMonth) | ||
const pastMonthYYYYMM = pastMonth.substring(0, 7).replace('-', '') | ||
|
||
declare({ | ||
database, | ||
schema: 'materialized', | ||
name: 'country_summary' | ||
}) | ||
|
||
assert('country_summary_not_empty').query(ctx => ` | ||
FROM ${ctx.ref(database, 'materialized', 'country_summary')} | ||
|> WHERE yyyymm = ${pastMonthYYYYMM} | ||
|> AGGREGATE COUNT(DISTINCT country_code) AS cnt_countries | ||
|> WHERE cnt_countries != 238 | ||
|> SELECT 'Table data doesn't match 238 countries' AS error_message; | ||
`) | ||
|
||
declare({ | ||
database, | ||
schema: 'materialized', | ||
name: 'device_summary' | ||
}) | ||
|
||
assert('device_summary_not_empty').query(ctx => ` | ||
FROM ${ctx.ref(database, 'materialized', 'device_summary')} | ||
|> WHERE date = ''${pastMonth}'' | ||
|> AGGREGATE COUNT(DISTINCT device) AS cnt_devices, COUNT(DISTINCT rank) AS cnt_ranks | ||
|> WHERE cnt_devices != 3 OR cnt_ranks != 10 | ||
|> SELECT 'Table data doesn't match 3 unique devices and 10 ranks' AS error_message; | ||
`) | ||
|
||
declare({ | ||
database, | ||
schema: 'experimental', | ||
name: 'global' | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const stagingTables = ['pages', 'requests', 'parsed_css'] | ||
for (const table of stagingTables) { | ||
declare({ | ||
schema: 'crawl_staging', | ||
name: table | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters