Skip to content

Commit a1341b4

Browse files
committed
tests: add thresholds to staging payments tests
1 parent de426f7 commit a1341b4

3 files changed

Lines changed: 45 additions & 14 deletions

File tree

warehouse/models/staging/payments/elavon/_elavon.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ models:
190190
- name: card_scheme_ref
191191
- name: trn_ref_num
192192
data_tests:
193-
- unique
193+
- unique_proportion:
194+
arguments:
195+
at_least: 0.9999
194196
- name: settlement_method
195197
- name: currency_code
196198
- name: cb_acq_ref_id
@@ -240,7 +242,9 @@ models:
240242
- name: card_scheme_ref
241243
- name: trn_ref_num
242244
data_tests:
243-
- unique
245+
- unique_proportion:
246+
arguments:
247+
at_least: 0.9999
244248
- name: settlement_method
245249
- name: currency_code
246250
- name: cb_acq_ref_id

warehouse/models/staging/payments/littlepay/_stg_littlepay.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ models:
168168
description: '{{ doc("lp_littlepay_transaction_id") }}'
169169
data_tests:
170170
- not_null
171-
- unique
171+
- unique_proportion:
172+
arguments:
173+
at_least: 0.9999
172174
- name: location_id
173175
description: The identifier of the location where the transaction occurred.
174176
- name: location_name
@@ -269,8 +271,9 @@ models:
269271
- name: micropayment_id
270272
description: '{{ doc("lp_micropayment_id") }}'
271273
data_tests:
272-
- unique:
274+
- unique_proportion:
273275
arguments:
276+
at_least: 0.9999
274277
where: applied
275278
- *participant_id
276279
- name: customer_id
@@ -330,8 +333,12 @@ models:
330333
- name: micropayment_id
331334
description: '{{ doc("lp_micropayment_id") }}'
332335
data_tests:
333-
- not_null
334-
- unique
336+
- dbt_utils.not_null_proportion:
337+
arguments:
338+
at_least: 0.9999
339+
- unique_proportion:
340+
arguments:
341+
at_least: 0.9999
335342
- name: aggregation_id
336343
description: '{{ doc("lp_aggregation_id") }}'
337344
- *participant_id
@@ -366,7 +373,9 @@ models:
366373
- name: product_id
367374
description: '{{ doc("lp_product_id") }}'
368375
data_tests:
369-
- not_null
376+
- dbt_utils.not_null_proportion:
377+
arguments:
378+
at_least: 0.9999
370379
- name: previous_version_id
371380
description: '{{ doc("lp_previous_version_id") }}'
372381
- name: original_version_id

warehouse/models/staging/payments/littlepay_v3/_stg_littlepay_v3.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,12 @@ models:
167167
- name: littlepay_transaction_id
168168
description: '{{ doc("lp_littlepay_transaction_id") }}'
169169
data_tests:
170-
- not_null
171-
- unique
170+
- dbt_utils.not_null_proportion:
171+
arguments:
172+
at_least: 0.9999
173+
- unique_proportion:
174+
arguments:
175+
at_least: 0.9999
172176
- name: location_id
173177
description: The identifier of the location where the transaction occurred.
174178
- name: location_name
@@ -269,8 +273,9 @@ models:
269273
- name: micropayment_id
270274
description: '{{ doc("lp_micropayment_id") }}'
271275
data_tests:
272-
- unique:
276+
- unique_proportion:
273277
arguments:
278+
at_least: 0.9999
274279
where: applied
275280
- *participant_id
276281
- name: customer_id
@@ -296,7 +301,14 @@ models:
296301
- *lp_export_ts
297302
- *lp_line_number
298303
- *payments_input_row_key
299-
- *payments_key_full_uniqueness
304+
- name: _payments_key
305+
description: |
306+
Synthentic key composed of the elements that define a natural key within the source data (primary key according to Littlepay schema.)
307+
data_tests:
308+
- not_null
309+
- unique_proportion:
310+
arguments:
311+
at_least: 0.9999
300312
- *_content_hash
301313

302314
- name: stg_littlepay__micropayment_device_transactions_v3
@@ -330,8 +342,12 @@ models:
330342
- name: micropayment_id
331343
description: '{{ doc("lp_micropayment_id") }}'
332344
data_tests:
333-
- not_null
334-
- unique
345+
- dbt_utils.not_null_proportion:
346+
arguments:
347+
at_least: 0.9999
348+
- unique_proportion:
349+
arguments:
350+
at_least: 0.9999
335351
- name: aggregation_id
336352
description: '{{ doc("lp_aggregation_id") }}'
337353
- *participant_id
@@ -366,7 +382,9 @@ models:
366382
- name: product_id
367383
description: '{{ doc("lp_product_id") }}'
368384
data_tests:
369-
- not_null
385+
- dbt_utils.not_null_proportion:
386+
arguments:
387+
at_least: 0.9999
370388
- name: previous_version_id
371389
description: '{{ doc("lp_previous_version_id") }}'
372390
- name: original_version_id

0 commit comments

Comments
 (0)