Open john-jerome opened 2 years ago
Hey, I believe this issue is still relevant - the web page is broken and the corresponding hook still doesn't work.
I'm also encountering the same error with 1.0.0
Can confirm using this commit outlined here, fixes the issue of not being able to find the command 🙂
https://github.com/offbi/pre-commit-dbt/issues/56
.pre-commit.yaml
...
- repo: https://github.com/offbi/pre-commit-dbt
rev: ea9c6bafbca375250baa9c21b8ddf9207d9c0160
hooks:
- id: check-model-has-description
- id: check-model-name-contract
args: [--pattern, "(base_|stg_).*"]
files: models/staging/
...
However, I'm not sure the command is running correctly as I keep getting an error.
The model is under this path models/staging/seeds/stg_countries.sql
and check-model-name-contract
keeps failing even though it starts with stg_
I'm also getting an error code which is not entirely helpful at debugging what the issue ie.
dbt docs generate........................................................Failed
- hook id: dbt-docs-generate
- exit code: 1
Executing cmd: `dbt docs generate`
Check staging models start with base_ or stg_............................Failed
- hook id: check-model-name-contract
- exit code: 1
I can confirm that the commit mentioned by @robertdefilippi fixes the issue with check-column-name-contract
as well
Also experiencing this. Accidentally filed a ticket in the wrong repo earlier 😅
❗ ❗ ❗
Just reiterating that people should take note of @robertdefilippi's "not sure the command is running correctly" comment below and assume that, even when using rev: ea9c6bafbca375250baa9c21b8ddf9207d9c0160
that this hook is broken.
During testing I saw no issues and had this running as expected like others have noted, however, very infrequently I encountered the issue below whereby dbt docs generate
is shown as failed however, this is seemingly caused by check-model-name-contract
:
However, I'm not sure the command is running correctly as I keep getting an error.
The model is under this path models/staging/seeds/stgcountries.sql and check-model-name-contract keeps failing even though it starts with stg I'm also getting an error code which is not entirely helpful at debugging what the issue ie.
dbt docs generate........................................................Failed - hook id: dbt-docs-generate - exit code: 1 Executing cmd: `dbt docs generate` Check staging models start with base_ or stg_............................Failed - hook id: check-model-name-contract - exit code: 1
Hello folks,
first I noticed that on this page when clicking on
check-column-name-contract
you get a 404 page. However, today I've decided to actually use this hook in my project and got the following error:[ERROR] `check-column-name-contract` is not present in repository https://github.com/offbi/pre-commit-dbt. Typo? Perhaps it is introduced in a newer version? Often `pre-commit autoupdate` fixes this.
To Reproduce Steps to reproduce the behavior:
check-column-name-contract
to your config fileVersion: v1.0.0