Skip to content

Commit 36607a5

Browse files
max-ostapenkoGCP Dataform
authored andcommitted
pages_per_client assert
1 parent cdad0da commit 36607a5

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

definitions/output/crawl/pages.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ ORDER BY cnt_pages DESC
3030
HAVING cnt_pages > 200
3131
`)
3232

33+
assert('pages_per_client')
34+
.tags(['crawl_complete'])
35+
.query(ctx => `
36+
SELECT
37+
client,
38+
COUNT(DISTINCT page) AS cnt_pages
39+
FROM ${ctx.ref('crawl_staging', 'pages')}
40+
WHERE
41+
date = '${constants.currentMonth}'
42+
GROUP BY
43+
client
44+
HAVING cnt_pages < 20000000
45+
`)
46+
3347
publish('pages', {
3448
type: 'incremental',
3549
protected: true,

0 commit comments

Comments
 (0)