Skip to content

Commit

Permalink
Feature - Allow conversion of column names to lower case to be config…
Browse files Browse the repository at this point in the history
…ured (#22)

* Update README.md

* Update evaluate_required_docs.sql

* Update macros/utils/required_docs/evaluate_required_docs.sql

Co-authored-by: Teghan Nightengale <[email protected]>
  • Loading branch information
GtheSheep and tnightengale authored Jan 25, 2022
1 parent 9d7279b commit a805949
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ dbt run-operation required_docs [--args "{'models': '<space_delimited_models>'}"
```
**Note:** Run this command _after_ `dbt run`: only models that already exist in
the warehouse can be validated for columns that are missing from the model `.yml`.
By default, column names are assumed to be lower case in the DBT documentation,
if this is not the case in your project, setting the variable
`convert_column_names_to_lower_case` to `false` in `dbt_project.yml` will
compare the column names in the case they appear.

## Contributions
Feedback on this project is welcomed and encouraged. Please open an issue or
Expand Down
4 changes: 3 additions & 1 deletion macros/utils/required_docs/evaluate_required_docs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@

{% for column in model_columns %}

{% set column = column | lower %}
{% if var("convert_column_names_to_lower_case", true) %}
{% set column = column | lower %}
{% endif %}

{% if column in model.columns.keys() %}

Expand Down

0 comments on commit a805949

Please sign in to comment.