Skip to content

Commit cf893f9

Browse files
max-ostapenkoGCP Dataform
authored andcommitted
fix month
1 parent 661a409 commit cf893f9

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

definitions/output/reports/reports_html_elements_popularity.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const pastMonth = constants.fnPastMonth(constants.currentMonth)
2-
31
publish('html_elements_popularity', {
42
schema: 'reports',
53
type: 'incremental',
@@ -18,7 +16,7 @@ try {
1816
''';
1917
2018
DELETE FROM ${ctx.self()}
21-
WHERE date = '${pastMonth}';
19+
WHERE date = '${constants.currentMonth}';
2220
`).query(ctx => `
2321
WITH pages_data AS (
2422
SELECT
@@ -29,7 +27,7 @@ WITH pages_data AS (
2927
custom_metrics.element_count
3028
FROM ${ctx.ref('crawl', 'pages')}
3129
WHERE
32-
date = '${pastMonth}' ${constants.devRankFilter}
30+
date = '${constants.currentMonth}' ${constants.devRankFilter}
3331
),
3432
3533
totals AS (
@@ -69,9 +67,9 @@ SELECT
6967
"destination": "cloud_storage",
7068
"config": {
7169
"bucket": "${constants.bucket}",
72-
"name": "${constants.storagePath}${pastMonth.replaceAll('-', '_')}/htmlElementPopularity.json"
70+
"name": "${constants.storagePath}${constants.currentMonth.replaceAll('-', '_')}/htmlElementPopularity.json"
7371
},
74-
"query": "SELECT * EXCEPT(date) FROM ${ctx.self()} WHERE date = '${pastMonth}'"
72+
"query": "SELECT * EXCEPT(date) FROM ${ctx.self()} WHERE date = '${constants.currentMonth}'"
7573
}'''
7674
);
7775
`)

0 commit comments

Comments
 (0)