Skip to content

Commit

Permalink
Fixing invalid yaml in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Labes authored and clrcrl committed Nov 23, 2020
1 parent caa4ca2 commit 70b528a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,21 +440,21 @@ models:
- name: account_created_at
tests:
- dbt_utils.accepted_range:
max_value: "getdate()"
#inclusive is true by default
max_value: "getdate()"
#inclusive is true by default
- name: num_returned_orders
tests:
- dbt_utils.accepted_range
min_value: 0
max_value: "num_orders"
- dbt_utils.accepted_range:
min_value: 0
max_value: "num_orders"
- name: num_web_sessions
tests:
- dbt_utils.accepted_range
min_value: 0
inclusive: false
where: "num_orders > 0"
- dbt_utils.accepted_range:
min_value: 0
inclusive: false
where: "num_orders > 0"
```

---
Expand Down
4 changes: 2 additions & 2 deletions macros/schema_tests/accepted_range.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ validation_errors as (

{%- if min_value is not none %}
-- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.
or not {{ column_name }} >{{"=" if inclusive}} {{min_value}}
or not {{ column_name }} > {{- "=" if inclusive }} {{ min_value }}
{%- endif %}

{%- if max_value is not none %}
-- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.
or not {{ column_name }} <{{"=" if inclusive}} {{max_value}}
or not {{ column_name }} < {{- "=" if inclusive }} {{ max_value }}
{%- endif %}
)

Expand Down

0 comments on commit 70b528a

Please sign in to comment.