Skip to content

fix: temporal series month/week wrap-around and add year to query pipeline#1376

Merged
danieljchuser merged 1 commit intomainfrom
fix/temporal-bug
Feb 25, 2026
Merged

fix: temporal series month/week wrap-around and add year to query pipeline#1376
danieljchuser merged 1 commit intomainfrom
fix/temporal-bug

Conversation

@danieljchuser
Copy link
Contributor

Summary

  • Fix month wrap-around in getTemporalCondition: changed currentMonth = 12 to currentMonth += 12, so months correctly resolve to Dec, Nov, Oct... instead of all becoming December
  • Fix week wrap-around: same pattern, currentWeek += 52/53 instead of currentWeek = 52/53
  • Add year to data pipeline: SQL raw CTE SELECT, query dimensions (alongside week/month), and TrafficDataResponseDto.toJSON() — enables correct cross-year sorting downstream

Bug introduced in commit aad2d1c (Nov 20, 2025).

Packages affected

Package Changes
spacecat-shared-utils Fix getTemporalCondition wrap-around logic
spacecat-shared-athena-client Add year to SQL templates, dimension pushes, and DTO

Test plan

  • Utils: 909 tests passing, 100% coverage
  • Athena-client: 180 tests passing, 100% coverage
  • Verify month wrap: month=1, numSeries=4 → months [1, 12, 11, 10] with years [2026, 2025, 2025, 2025]
  • Verify week wrap: week=1, numSeries=5 → weeks [1, 52, 51, 50, 49] across year boundary
  • Verify API response includes year field in temporal series data after deploy

🤖 Generated with Claude Code

…eline

Fix month wrap-around in getTemporalCondition using += 12 instead of = 12,
and week wrap-around using += 52/53 instead of = 52/53. Add year column
to all SQL raw CTEs, query dimensions, and DTO output so cross-year
temporal series data can be correctly sorted downstream.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@danieljchuser danieljchuser self-assigned this Feb 25, 2026
@danieljchuser danieljchuser merged commit b15cfd7 into main Feb 25, 2026
7 checks passed
@danieljchuser danieljchuser deleted the fix/temporal-bug branch February 25, 2026 09:16
solaris007 pushed a commit that referenced this pull request Feb 25, 2026
## [@adobe/spacecat-shared-athena-client-v1.9.3](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-athena-client-v1.9.2...@adobe/spacecat-shared-athena-client-v1.9.3) (2026-02-25)

### Bug Fixes

* temporal series month/week wrap-around and add year to query pipeline ([#1376](#1376)) ([b15cfd7](b15cfd7))
@solaris007
Copy link
Member

🎉 This PR is included in version @adobe/spacecat-shared-athena-client-v1.9.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

solaris007 pushed a commit that referenced this pull request Feb 25, 2026
## [@adobe/spacecat-shared-utils-v1.96.2](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.96.1...@adobe/spacecat-shared-utils-v1.96.2) (2026-02-25)

### Bug Fixes

* temporal series month/week wrap-around and add year to query pipeline ([#1376](#1376)) ([b15cfd7](b15cfd7))
@solaris007
Copy link
Member

🎉 This PR is included in version @adobe/spacecat-shared-utils-v1.96.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

danieljchuser added a commit that referenced this pull request Feb 25, 2026
)

## Summary

- Reverts commit f07d153 which changed aggregation granularity levels
for `link-name`, `button-name`, and `select-name` from
`PER_PAGE_PER_COMPONENT` to `PER_COMPONENT`
- These changes introduced breaking behavior in the accessibility
suggestion aggregation pipeline
- This revert restores the original granularity levels to match v1.96.0
behavior

## Context

PR #1376 (temporal fix) was merged and published as utils v1.96.2, but
it included the aggregation changes from v1.96.1. This revert ensures
the next published version (1.96.3) contains only the temporal fix
without the breaking aggregation changes.

## Test plan

- [x] All existing tests pass (909 passing, 100% coverage)
- [x] Test assertions updated to match reverted granularity levels

🤖 Generated with [Claude Code](https://claude.com/claude-code)
solaris007 pushed a commit that referenced this pull request Feb 25, 2026
## [@adobe/spacecat-shared-utils-v1.96.3](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-utils-v1.96.2...@adobe/spacecat-shared-utils-v1.96.3) (2026-02-25)

### Bug Fixes

* revert breaking aggregation granularity changes from v1.96.1 ([#1378](#1378)) ([fbc00f4](fbc00f4)), closes [#1376](#1376)
danieljchuser added a commit that referenced this pull request Feb 25, 2026
## Summary

- Bumps `@adobe/spacecat-shared-utils` dependency in athena-client from
`1.82.1` to `1.96.3`
- v1.96.3 includes the temporal condition month/week wrap-around fix
(from #1376) with the aggregation granularity revert (from #1378)

## Context

Part of the PTR temporal series bugfix. The athena-client consumes
shared-utils via npm (not workspace link), so this explicit bump is
needed before downstream consumers (spacecat-api-service) can pick up
the fix.

## Test plan

- [x] All 180 athena-client tests pass with 100% coverage
- [x] No code changes — dependency version bump only

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
solaris007 pushed a commit that referenced this pull request Feb 25, 2026
## [@adobe/spacecat-shared-athena-client-v1.9.4](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-athena-client-v1.9.3...@adobe/spacecat-shared-athena-client-v1.9.4) (2026-02-25)

### Bug Fixes

* bump athena-client utils dep to 1.96.3 ([#1379](#1379)) ([03fe3e9](03fe3e9)), closes [#1376](#1376) [#1378](#1378)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants