@adobe/spacecat-shared-athena-client 1.7.0 → 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,10 @@
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
+
1
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)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-athena-client",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Shared modules of the Spacecat Services - AWS Athena Client",
5
5
  "type": "module",
6
6
  "engines": {
@@ -105,6 +105,11 @@ export function getTrafficAnalysisQueryPlaceholdersFilled({
105
105
  throw new Error('Missing dimension to group by');
106
106
  }
107
107
 
108
+ if (numTemporalSeries > 1 && week) {
109
+ dimensions.push('week');
110
+ } else if (numTemporalSeries > 1 && month) {
111
+ dimensions.push('month');
112
+ }
108
113
  const dimensionColumns = dimensions.join(', ');
109
114
  const dimensionColumnsPrefixed = dimensions.map((col) => `a.${col}`).join(', ');
110
115
 
@@ -49,6 +49,7 @@ WITH min_totals AS (
49
49
  raw AS (
50
50
  SELECT
51
51
  week,
52
+ month,
52
53
  path,
53
54
  ${pageTypeCase},
54
55
  trf_type,
@@ -77,7 +78,6 @@ raw AS (
77
78
  ),
78
79
  agg AS (
79
80
  SELECT
80
- week,
81
81
  ${dimensionColumns},
82
82
  COUNT(*) AS row_count,
83
83
  CAST(SUM(pageviews) AS BIGINT) AS pageviews,
@@ -89,13 +89,12 @@ agg AS (
89
89
  approx_percentile(cls, 0.70) AS p70_cls,
90
90
  approx_percentile(inp, 0.70) AS p70_inp
91
91
  FROM raw
92
- GROUP BY week, ${groupBy}
92
+ GROUP BY ${groupBy}
93
93
  ),
94
94
  grand_total AS (
95
95
  SELECT CAST(SUM(pageviews) AS BIGINT) AS total_pv FROM agg
96
96
  )
97
97
  SELECT
98
- a.week,
99
98
  ${dimensionColumnsPrefixed},
100
99
  a.pageviews,
101
100
  CAST(a.pageviews AS DOUBLE) / NULLIF(t.total_pv, 0) AS pct_pageviews,