@@ -67,7 +67,7 @@ For compatibility details between versions of dbt-core and dbt-utils, [see this
67
67
[ Materializations] ( #materializations ) :
68
68
- [ insert_by_period] ( #insert_by_period-source )
69
69
70
- ---
70
+ ----
71
71
### Schema Tests
72
72
#### equal_rowcount ([ source] ( macros/schema_tests/equal_rowcount.sql ) )
73
73
This schema test asserts the that two relations have the same number of rows.
@@ -310,6 +310,7 @@ models:
310
310
to: ref('other_model_name')
311
311
field: client_id
312
312
from_condition: id <> '4ca448b8-24bf-4b88-96c6-b1609499c38b'
313
+ to_condition: created_date >= '2020-01-01'
313
314
` ` `
314
315
315
316
# ### mutually_exclusive_ranges ([source](macros/schema_tests/mutually_exclusive_ranges.sql))
@@ -377,53 +378,58 @@ models:
377
378
partition_by: customer_id
378
379
gaps: allowed
379
380
` ` `
381
+ <details>
382
+ <summary>Additional `gaps` and `zero_length_range_allowed` examples</summary>
383
+
384
+ **Understanding the `gaps` argument:**
385
+
386
+ Here are a number of examples for each allowed `gaps` argument.
387
+ * `gaps: not_allowed`: The upper bound of one record must be the lower bound of
388
+ the next record.
389
+
390
+ | lower_bound | upper_bound |
391
+ |-------------|-------------|
392
+ | 0 | 1 |
393
+ | 1 | 2 |
394
+ | 2 | 3 |
395
+
396
+ * `gaps: allowed` (default): There may be a gap between the upper bound of one
397
+ record and the lower bound of the next record.
398
+
399
+ | lower_bound | upper_bound |
400
+ |-------------|-------------|
401
+ | 0 | 1 |
402
+ | 2 | 3 |
403
+ | 3 | 4 |
404
+
405
+ * `gaps: required`: There must be a gap between the upper bound of one record and
406
+ the lower bound of the next record (common for date ranges).
407
+
408
+ | lower_bound | upper_bound |
409
+ |-------------|-------------|
410
+ | 0 | 1 |
411
+ | 2 | 3 |
412
+ | 4 | 5 |
413
+
414
+ **Understanding the `zero_length_range_allowed` argument:**
415
+ Here are a number of examples for each allowed `zero_length_range_allowed` argument.
416
+ * `zero_length_range_allowed: false`: (default) The upper bound of each record must be greater than its lower bound.
417
+
418
+ | lower_bound | upper_bound |
419
+ |-------------|-------------|
420
+ | 0 | 1 |
421
+ | 1 | 2 |
422
+ | 2 | 3 |
423
+
424
+ * `zero_length_range_allowed: true`: The upper bound of each record can be greater than or equal to its lower bound.
425
+
426
+ | lower_bound | upper_bound |
427
+ |-------------|-------------|
428
+ | 0 | 1 |
429
+ | 2 | 2 |
430
+ | 3 | 4 |
380
431
381
- **Understanding the `gaps` argument:**
382
- Here are a number of examples for each allowed `gaps` argument.
383
- * `gaps: not_allowed`: The upper bound of one record must be the lower bound of
384
- the next record.
385
-
386
- | lower_bound | upper_bound |
387
- |-------------|-------------|
388
- | 0 | 1 |
389
- | 1 | 2 |
390
- | 2 | 3 |
391
-
392
- * `gaps: allowed` (default): There may be a gap between the upper bound of one
393
- record and the lower bound of the next record.
394
-
395
- | lower_bound | upper_bound |
396
- |-------------|-------------|
397
- | 0 | 1 |
398
- | 2 | 3 |
399
- | 3 | 4 |
400
-
401
- * `gaps: required`: There must be a gap between the upper bound of one record and
402
- the lower bound of the next record (common for date ranges).
403
-
404
- | lower_bound | upper_bound |
405
- |-------------|-------------|
406
- | 0 | 1 |
407
- | 2 | 3 |
408
- | 4 | 5 |
409
-
410
- **Understanding the `zero_length_range_allowed` argument:**
411
- Here are a number of examples for each allowed `zero_length_range_allowed` argument.
412
- * `zero_length_range_allowed: false`: (default) The upper bound of each record must be greater than its lower bound.
413
-
414
- | lower_bound | upper_bound |
415
- |-------------|-------------|
416
- | 0 | 1 |
417
- | 1 | 2 |
418
- | 2 | 3 |
419
-
420
- * `zero_length_range_allowed: true`: The upper bound of each record can be greater than or equal to its lower bound.
421
-
422
- | lower_bound | upper_bound |
423
- |-------------|-------------|
424
- | 0 | 1 |
425
- | 2 | 2 |
426
- | 3 | 4 |
432
+ </details>
427
433
428
434
# ### sequential_values ([source](macros/schema_tests/sequential_values.sql))
429
435
This test confirms that a column contains sequential values. It can be used
0 commit comments