Skip to content

Commit 9250ad7

Browse files
authored
Merge pull request #11 from DataRecce/feature/drc-359-demo-setup-the-preset-checks-for-demo-project
[Infra] DRC-359 Add preset checks for Recce CI
2 parents f34c241 + 7b7b17d commit 9250ad7

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/recce_ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
- name: Install Recce
2424
run: |
2525
pip install recce
26+
- name: Add packages.yml file
27+
run: |
28+
echo '${{ vars.PACKAGES_YAML }}' > packages.yml
2629
- name: Prepare dbt Base environment
2730
run: |
2831
if aws s3 cp s3://$AWS_S3_BUCKET/${{ github.event.pull_request.base.sha }}.tar.gz .; then

recce.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# [Optional] GitHub settings
2+
github:
3+
repo: "DataRecce/jaffle_shop_duckdb"
4+
5+
# Recce Preset Checks
6+
checks:
7+
- name: Model schema of customers
8+
description: The schema of customers should not be changed
9+
type: schema_diff
10+
params:
11+
node_id: model.jaffle_shop.customers
12+
- name: Model schema of orders
13+
description: The schema of orders should not be changed
14+
type: schema_diff
15+
params:
16+
node_id: model.jaffle_shop.orders
17+
- name: Row count of customers and orders models
18+
description: The row count of customers and order should not be changed
19+
type: row_count_diff
20+
params:
21+
node_names:
22+
- customers
23+
- orders
24+
- name: Value diff of customers
25+
description: The customer_lifetime_value in customers should be 100% matched
26+
type: value_diff
27+
params:
28+
model: customers
29+
primary_key: customer_id
30+
columns:
31+
- customer_id
32+
- customer_lifetime_value
33+
- name: Query diff of customers avg lifetime value
34+
description: The average of customer_lifetime_value should not be changed
35+
type: query_diff
36+
params:
37+
sql_template: |-
38+
SELECT
39+
DATE_TRUNC('week', first_order) AS first_order_week,
40+
AVG(customer_lifetime_value) AS avg_lifetime_value
41+
FROM
42+
{{ ref("customers") }}
43+
WHERE first_order is not NULL
44+
GROUP BY
45+
first_order_week
46+
ORDER BY
47+
first_order_week;

0 commit comments

Comments
 (0)