@adobe/spacecat-shared-athena-client 1.6.1 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [@adobe/spacecat-shared-athena-client-v1.7.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-athena-client-v1.7.0...@adobe/spacecat-shared-athena-client-v1.7.1) (2025-11-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* athena weekly - add week/month to dimensions ([#1158](https://github.com/adobe/spacecat-shared/issues/1158)) ([e90d243](https://github.com/adobe/spacecat-shared/commit/e90d2433faebc5a2890b65e1e7a6933084609537))
|
|
7
|
+
|
|
8
|
+
# [@adobe/spacecat-shared-athena-client-v1.7.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-athena-client-v1.6.1...@adobe/spacecat-shared-athena-client-v1.7.0) (2025-11-20)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* athena multi week queries ([#1157](https://github.com/adobe/spacecat-shared/issues/1157)) ([8a4f54b](https://github.com/adobe/spacecat-shared/commit/8a4f54b9cff7248eae1b7ea772f09a2d7e64579f))
|
|
14
|
+
|
|
1
15
|
# [@adobe/spacecat-shared-athena-client-v1.6.1](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-athena-client-v1.6.0...@adobe/spacecat-shared-athena-client-v1.6.1) (2025-11-15)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/spacecat-shared-athena-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "Shared modules of the Spacecat Services - AWS Athena Client",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
38
|
+
"@adobe/spacecat-shared-utils": "1.77.1",
|
|
39
|
+
"@aws-sdk/client-athena": "3.932.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"chai": "6.2.1",
|
|
@@ -91,6 +91,7 @@ export function getTrafficAnalysisQueryPlaceholdersFilled({
|
|
|
91
91
|
trfTypes = null,
|
|
92
92
|
temporalCondition = null,
|
|
93
93
|
pageViewThreshold = 1000,
|
|
94
|
+
numTemporalSeries = 1,
|
|
94
95
|
}) {
|
|
95
96
|
if (!siteId || !tableName) {
|
|
96
97
|
throw new Error('Missing required parameters: siteId, or tableName');
|
|
@@ -104,12 +105,22 @@ export function getTrafficAnalysisQueryPlaceholdersFilled({
|
|
|
104
105
|
throw new Error('Missing dimension to group by');
|
|
105
106
|
}
|
|
106
107
|
|
|
108
|
+
if (numTemporalSeries > 1 && week) {
|
|
109
|
+
dimensions.push('week');
|
|
110
|
+
} else if (numTemporalSeries > 1 && month) {
|
|
111
|
+
dimensions.push('month');
|
|
112
|
+
}
|
|
107
113
|
const dimensionColumns = dimensions.join(', ');
|
|
108
114
|
const dimensionColumnsPrefixed = dimensions.map((col) => `a.${col}`).join(', ');
|
|
109
115
|
|
|
110
116
|
let tempCondition = null;
|
|
111
117
|
if (!temporalCondition) {
|
|
112
|
-
tempCondition = getTemporalCondition({
|
|
118
|
+
tempCondition = getTemporalCondition({
|
|
119
|
+
week,
|
|
120
|
+
month,
|
|
121
|
+
year,
|
|
122
|
+
numSeries: numTemporalSeries,
|
|
123
|
+
});
|
|
113
124
|
}
|
|
114
125
|
|
|
115
126
|
let pageTypeCase = 'NULL as page_type';
|
|
@@ -48,8 +48,10 @@ WITH min_totals AS (
|
|
|
48
48
|
),
|
|
49
49
|
raw AS (
|
|
50
50
|
SELECT
|
|
51
|
+
week,
|
|
52
|
+
month,
|
|
51
53
|
path,
|
|
52
|
-
${pageTypeCase},
|
|
54
|
+
${pageTypeCase},
|
|
53
55
|
trf_type,
|
|
54
56
|
trf_channel,
|
|
55
57
|
trf_platform,
|
|
@@ -64,7 +66,7 @@ raw AS (
|
|
|
64
66
|
clicked,
|
|
65
67
|
engaged,
|
|
66
68
|
latest_scroll,
|
|
67
|
-
CASE WHEN latest_scroll >= 10000 THEN 1 ELSE 0 END AS engaged_scroll,
|
|
69
|
+
CASE WHEN latest_scroll >= 10000 THEN 1 ELSE 0 END AS engaged_scroll,
|
|
68
70
|
lcp,
|
|
69
71
|
cls,
|
|
70
72
|
inp
|