@adobe/spacecat-shared-athena-client 1.7.0 → 1.7.2

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.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-athena-client-v1.7.1...@adobe/spacecat-shared-athena-client-v1.7.2) (2025-11-20)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * athena query - remove dimension check ([#1160](https://github.com/adobe/spacecat-shared/issues/1160)) ([e845b6e](https://github.com/adobe/spacecat-shared/commit/e845b6ee92957a5f7b0c2495aef34e66a266a871))
7
+
8
+ # [@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)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * 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))
14
+
1
15
  # [@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
16
 
3
17
 
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.2",
4
4
  "description": "Shared modules of the Spacecat Services - AWS Athena Client",
5
5
  "type": "module",
6
6
  "engines": {
@@ -84,7 +84,7 @@ export function getTrafficAnalysisQueryPlaceholdersFilled({
84
84
  month,
85
85
  year,
86
86
  siteId,
87
- dimensions,
87
+ dimensions = [],
88
88
  tableName,
89
89
  pageTypes = null,
90
90
  pageTypeMatchColumn = 'path',
@@ -101,10 +101,11 @@ export function getTrafficAnalysisQueryPlaceholdersFilled({
101
101
  throw new Error('Missing required parameters: week, month or year');
102
102
  }
103
103
 
104
- if (!Array.isArray(dimensions) || dimensions.length === 0) {
105
- throw new Error('Missing dimension to group by');
104
+ if (numTemporalSeries > 1 && week) {
105
+ dimensions.push('week');
106
+ } else if (numTemporalSeries > 1 && month) {
107
+ dimensions.push('month');
106
108
  }
107
-
108
109
  const dimensionColumns = dimensions.join(', ');
109
110
  const dimensionColumnsPrefixed = dimensions.map((col) => `a.${col}`).join(', ');
110
111
 
@@ -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,