Skip to content

Commit 00a4b4e

Browse files
committed
Merge branch 'main' into standard_reports
2 parents 28cebce + ef00169 commit 00a4b4e

28 files changed

Lines changed: 430 additions & 170 deletions

definitions/output/blink_features/features.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ publish('features', {
66
partitionBy: 'yyyymmdd',
77
clusterBy: ['client', 'rank']
88
},
9-
tags: ['crawl_complete']
9+
tags: ['crawl_complete', 'blink_report']
1010
}).preOps(ctx => `
1111
DELETE FROM ${ctx.self()}
1212
WHERE yyyymmdd = DATE '${constants.currentMonth}';

definitions/output/blink_features/usage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ publish('usage', {
22
schema: 'blink_features',
33
type: 'incremental',
44
protected: true,
5-
tags: ['crawl_complete']
5+
tags: ['crawl_complete', 'blink_report']
66
}).preOps(ctx => `
77
DELETE FROM ${ctx.self()}
88
WHERE yyyymmdd = REPLACE('${constants.currentMonth}', '-', '');

definitions/output/core_web_vitals/technologies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ publish('technologies', {
99
clusterBy: ['geo', 'app', 'rank', 'client'],
1010
requirePartitionFilter: true
1111
},
12-
tags: ['crux_ready'],
12+
tags: ['crux_ready', 'tech_report'],
1313
dependOnDependencyAssertions: true
1414
}).preOps(ctx => `
1515
DELETE FROM ${ctx.self()}

definitions/output/crawl/pages.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ WHERE date = '${constants.currentMonth}' AND
7373
${constants.devRankFilter}
7474
`).postOps(ctx => `
7575
CREATE TEMP TABLE technologies_cleaned AS (
76-
WITH wappalyzer AS (
76+
WITH technologies AS (
7777
SELECT DISTINCT
7878
name AS technology,
7979
categories
@@ -101,13 +101,13 @@ CREATE TEMP TABLE technologies_cleaned AS (
101101
LEFT JOIN pages.categories AS category
102102
WHERE
103103
-- Technology is corrupted
104-
technology NOT IN (SELECT DISTINCT technology FROM wappalyzer) OR
104+
technology NOT IN (SELECT DISTINCT technology FROM technologies) OR
105105
-- Technology's category is corrupted
106106
CONCAT(technology, category) NOT IN (
107107
SELECT DISTINCT
108108
CONCAT(technology, category)
109-
FROM wappalyzer
110-
LEFT JOIN wappalyzer.categories AS category
109+
FROM technologies
110+
INNER JOIN technologies.categories AS category
111111
)
112112
),
113113
@@ -118,14 +118,14 @@ CREATE TEMP TABLE technologies_cleaned AS (
118118
page,
119119
ARRAY_AGG(STRUCT(
120120
pages.technology,
121-
wappalyzer.categories,
121+
technologies.categories,
122122
pages.info
123123
)) AS technologies
124124
FROM pages
125125
INNER JOIN impacted_pages
126126
USING (client, page)
127-
INNER JOIN wappalyzer
128-
ON pages.technology = wappalyzer.technology
127+
INNER JOIN technologies
128+
USING (technology)
129129
GROUP BY
130130
client,
131131
page
@@ -134,8 +134,10 @@ CREATE TEMP TABLE technologies_cleaned AS (
134134
SELECT
135135
client,
136136
page,
137-
technologies
138-
FROM reconstructed_technologies
137+
reconstructed_technologies.technologies
138+
FROM impacted_pages
139+
LEFT JOIN reconstructed_technologies
140+
USING(client,page)
139141
);
140142
141143
-- Update the crawl.pages table with the cleaned and restored technologies

definitions/output/reports/cwv_tech_adoption.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ publish('cwv_tech_adoption', {
88
partitionBy: 'date',
99
clusterBy: ['rank', 'geo']
1010
},
11-
tags: ['crux_ready']
11+
tags: ['crux_ready', 'tech_report']
1212
}).preOps(ctx => `
1313
DELETE FROM ${ctx.self()}
1414
WHERE date = '${pastMonth}';

definitions/output/reports/cwv_tech_categories.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const pastMonth = constants.fnPastMonth(constants.currentMonth)
33
publish('cwv_tech_categories', {
44
schema: 'reports',
55
type: 'table',
6-
tags: ['crux_ready']
6+
tags: ['crux_ready', 'tech_report']
77
}).query(ctx => `
88
/* {"dataform_trigger": "report_cwv_tech_complete", "name": "categories", "type": "dict"} */
99
WITH pages AS (
@@ -71,5 +71,22 @@ GROUP BY
7171
category,
7272
description,
7373
origins
74-
ORDER BY category ASC
74+
75+
UNION ALL
76+
77+
SELECT
78+
'ALL' AS category,
79+
NULL AS description,
80+
STRUCT(
81+
COALESCE(MAX(IF(client = 'desktop', origins, 0))) AS desktop,
82+
COALESCE(MAX(IF(client = 'mobile', origins, 0))) AS mobile
83+
) AS origins,
84+
NULL AS technologies
85+
FROM (
86+
SELECT
87+
client,
88+
COUNT(DISTINCT root_page) AS origins
89+
FROM pages
90+
GROUP BY client
91+
)
7592
`)

definitions/output/reports/cwv_tech_core_web_vitals.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ publish('cwv_tech_core_web_vitals', {
88
partitionBy: 'date',
99
clusterBy: ['rank', 'geo']
1010
},
11-
tags: ['crux_ready']
11+
tags: ['crux_ready', 'tech_report']
1212
}).preOps(ctx => `
1313
CREATE TEMPORARY FUNCTION GET_VITALS(
1414
records ARRAY<STRUCT<

definitions/output/reports/cwv_tech_lighthouse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ publish('cwv_tech_lighthouse', {
88
partitionBy: 'date',
99
clusterBy: ['rank', 'geo']
1010
},
11-
tags: ['crux_ready']
11+
tags: ['crux_ready', 'tech_report']
1212
}).preOps(ctx => `
1313
CREATE TEMPORARY FUNCTION GET_LIGHTHOUSE(
1414
records ARRAY<STRUCT<

definitions/output/reports/cwv_tech_page_weight.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ publish('cwv_tech_page_weight', {
88
partitionBy: 'date',
99
clusterBy: ['rank', 'geo']
1010
},
11-
tags: ['crux_ready']
11+
tags: ['crux_ready', 'tech_report']
1212
}).preOps(ctx => `
1313
CREATE TEMPORARY FUNCTION GET_PAGE_WEIGHT(
1414
records ARRAY<STRUCT<

definitions/output/reports/cwv_tech_technologies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const pastMonth = constants.fnPastMonth(constants.currentMonth)
33
publish('cwv_tech_technologies', {
44
schema: 'reports',
55
type: 'table',
6-
tags: ['crux_ready']
6+
tags: ['crux_ready', 'tech_report']
77
}).query(ctx => `
88
/* {"dataform_trigger": "report_cwv_tech_complete", "name": "technologies", "type": "dict"} */
99
WITH pages AS (

0 commit comments

Comments
 (0)