Skip to content

Commit

Permalink
use stage in query
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewHEguardian committed Apr 16, 2024
1 parent 92fbffe commit 01ac3fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bandit/src/query-lambda/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const buildQuery = (
ab.name test_name,
ab.variant variant_name,
COUNT(*) views
FROM acquisition.epic_views_prod, UNNEST(abtests) t(ab)
FROM acquisition.epic_views_${stage}, UNNEST(abtests) t(ab)
WHERE date_hour >= timestamp'${startTimestamp}' AND date_hour < timestamp'${endTimestamp}'
AND ab.name = '${test.name}'
GROUP BY 1,2
Expand All @@ -28,7 +28,7 @@ const buildQuery = (
ab.variant variant_name,
SUM(annualisedvaluegbp) av_gbp,
COUNT(*) acquisitions
FROM acquisition.acquisition_events_prod, UNNEST(abtests) t(ab)
FROM acquisition.acquisition_events_${stage}, UNNEST(abtests) t(ab)
WHERE acquisition_date >= date'${format(start, "yyyy-MM-dd")}'
AND timestamp >= timestamp'${startTimestamp}' AND timestamp < timestamp'${endTimestamp}'
AND ab.name = '${test.name}'
Expand Down

0 comments on commit 01ac3fe

Please sign in to comment.