Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 33 additions & 11 deletions .github/workflows/recce_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,35 @@ on:
branches: [main]

jobs:
check-pull-request:
prepare-artifacts:
name: Prepare for Recce
runs-on: ubuntu-latest
steps:
- name: Trigger the dbt cloud job and fetch artifacts for Recce
uses: datarecce/dbt-cloud-action@main
id: recce_dbt_cloud_run
with:
dbt_cloud_token: ${{ secrets.DBT_CLOUD_API_TOKEN }}
dbt_cloud_account_id: 62083
dbt_cloud_base_job_id: 747906
dbt_cloud_current_job_id: 747907
failure_on_error: true

- name: Upload DBT Artifacts for CICD job
uses: actions/upload-artifact@v4
with:
name: target
path: target/

- name: Upload DBT Artifacts for Prod job
uses: actions/upload-artifact@v4
with:
name: target-base
path: target-base/

recce-run:
needs: prepare-artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -20,21 +46,17 @@ jobs:
- name: Install dependencies
run: pip install -r requirements.txt

- name: Trigger the dbt cloud job and fetch artifacts for Recce
uses: datarecce/dbt-cloud-action@main
id: recce_dbt_cloud_run
with:
dbt_cloud_token: ${{ secrets.DBT_CLOUD_API_TOKEN }}
dbt_cloud_account_id: 62083
dbt_cloud_base_job_id: 747906
dbt_cloud_current_job_id: 747907
failure_on_error: true

- uses: "google-github-actions/auth@v2"
id: google-auth
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY_JSON }}

- name: Download artifactss
uses: actions/download-artifact@v4

- name: Update dbt dependencies
run: dbt deps

- name: Run Recce in cloud mode
env:
BQ_PROJECT: ${{ steps.google-auth.outputs.project_id }}
Expand Down
2 changes: 1 addition & 1 deletion models/marts/customers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ customer_orders_summary as (
orders.customer_id,

count(distinct orders.order_id) as count_lifetime_orders,
count(distinct orders.order_id) > 1 as is_repeat_buyer,
count(distinct orders.order_id) > 2 as is_repeat_buyer,
min(orders.ordered_at) as first_ordered_at,
max(orders.ordered_at) as last_ordered_at,
sum(orders.subtotal) as lifetime_spend_pretax,
Expand Down