Skip to content

Fix the daily SpaceTech report query on production Redshift - #2655

Open
jmgasper wants to merge 1 commit into
devfrom
fix/spacetech-prod-daily-query
Open

jmgasper wants to merge 1 commit into
devfrom
fix/spacetech-prod-daily-query

Conversation

@jmgasper

@jmgasper jmgasper commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

The production SpaceTech dashboard displayed “Daily source data is unavailable” because its deployed analytics Lambda still returned only weekly source metrics. Preflighting the updated handler also exposed a production Redshift error: the planner rejected the final ORDER BY on the UNION ALL that includes the source GROUPING SETS.

This change wraps the combined report rows in a CTE and applies the existing ordering in the outer SELECT. The daily, weekly, and full-period aggregates use their existing filters and metric definitions.

The revised query returned 116 rows for November 5–19 on production Redshift. All 37 analytics handler and SQL tests passed locally.

Production rollout completed. The shared API route targets the updated Lambda. A direct production Lambda invocation returned HTTP 200 with daily metrics for all four sources on each of the 15 UTC dates from November 5 through November 19. The page-view series matched an independent warehouse aggregation for every day and source.

@jmgasper
jmgasper requested a review from kkartunov as a code owner November 19, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant