dbt-checkpoint/dbt-checkpoint

`check-column-name-contract` doesn't output the name of the files

coldborecapital opened this issue · 1 comments

Describe the bug
When executing the hook, output looks like this

Check Column Name Contract Boolean.......................................Failed
- hook id: check-column-name-contract
- exit code: 1

ORGANIC_SOURCE: column is of type boolean and does not match regex pattern is_.*.
IS_MEDICAL: name matches regex pattern is_.* and is of type NUMBER instead of boolean.
ABANDONED: column is of type boolean and does not match regex pattern is_.*.
IS_MIXED: name matches regex pattern is_.* and is of type TEXT instead of boolean.
IS_MIXED: name matches regex pattern is_.* and is of type TEXT instead of boolean.
ORGANIC_SOURCE: column is of type boolean and does not match regex pattern is_.*.
IS_MIXED: name matches regex pattern is_.* and is of type TEXT instead of boolean.
ORGANIC_SOURCE: column is of type boolean and does not match regex pattern is_.*.
IS_MIXED: name matches regex pattern is_.* and is of type TEXT instead of boolean.
IS_MEDICAL: name matches regex pattern is_.* and is of type NUMBER instead of boolean.
ORGANIC_SOURCE: column is of type boolean and does not match regex pattern is_.*.

There is no easy way to tell which models the columns belong to.

To Reproduce
Steps to reproduce the behavior:

  1. Added check column name contract test with pattern something like
      - id: check-column-name-contract
        name: Check Column Name Contract Boolean
        args: [ "--pattern", "is_.*", "--dtype", "boolean", "--" ]

or (tried with an without the extra "--")

      - id: check-column-name-contract
       name: Check Column Name Contract Boolean
       args: [ "--pattern", "is_.*", "--dtype", "boolean"]
  1. observe output does not include the file name

Expected behavior
I expect that the output would include the file name or path where the column failing the check is found.

Version:
v1.2.0

Additional context
No additional context

Implemented in #180