check-macro-has-meta-keys
What it doesEnsures that the macro has a list of valid meta keys. (usually
schema.yml). When to use itIf every macro needs to have certain meta keys.--manifest: location of manifest.json file. Usually target/manifest.json. This file contains a full representation of dbt project. Default: target/manifest.json--meta-keys: list of the required keys in the meta part of the macro.--allow-extra-keys: whether extra keys are allowed. Default: False.
Example
-- as the last argument. Otherwise pre-commit would not be able to separate a list of files with args.
Requirements
1 It means that you need to run
dbt parse before run this hook (dbt >= 1.5).2 It means that you need to run
dbt docs generate before run this hook.
How it works
- Hook takes all changed
ymlfiles. - The manifest is scanned for a macro.
- If any macro (from a manifest or
ymlfiles) does not have specified meta keys, the hook fails. - The meta keys must be in either the yml file or the manifest.
run your macro and then you delete meta keys from a properties file, the hook success since the meta keys is still present in manifest.json.
check-seed-has-meta-keys
What it doesEnsures that the seed has a list of valid meta keys. (usually
schema.yml).When to use itIf every seed needs to have certain meta keys.--manifest: location of manifest.json file. Usually target/manifest.json. This file contains a full representation of dbt project. Default: target/manifest.json--meta-keys: list of the required keys in the meta part of the seed.--allow-extra-keys: whether extra keys are allowed. Default: False.
Example
-- as the last argument. Otherwise pre-commit would not be able to separate a list of files with args.
Requirements
1 It means that you need to run
dbt parse before run this hook (dbt >= 1.5).2 It means that you need to run
dbt docs generate before run this hook.
How it works
- Hook takes all changed
ymlfiles. - The manifest is scanned for a seed.
- If any seed (from a manifest or
ymlfiles) does not have specified meta keys, the hook fails. - The meta keys must be in either the yml file or the manifest.
run your seed and then you delete meta keys from a properties file, the hook success since the meta keys is still present in manifest.json.
check-snapshot-has-meta-keys
What it doesEnsures that the snapshot has a list of valid meta keys. (usually
schema.yml).When to use itIf every snapshot needs to have certain meta keys.--manifest: location of manifest.json file. Usually target/manifest.json. This file contains a full representation of dbt project. Default: target/manifest.json--meta-keys: list of the required keys in the meta part of the snapshot.--allow-extra-keys: whether extra keys are allowed. Default: False.
Example
-- as the last argument. Otherwise pre-commit would not be able to separate a list of files with args.
Requirements
1 It means that you need to run
dbt parse before run this hook (dbt >= 1.5).2 It means that you need to run
dbt docs generate before run this hook.
How it works
- Hook takes all changed
ymlandsqlfiles. - The manifest is scanned for a snapshot.
- If any snapshot (from a manifest or
ymlfiles) does not have specified meta keys, the hook fails. - The meta keys must be in either the yml file or the manifest.
run your snapshot and then you delete meta keys from a properties file, the hook success since the meta keys is still present in manifest.json.
check-test-has-meta-keys
What it doesEnsures that the test has a list of valid meta keys. (usually
schema.yml).When to use itIf every test needs to have certain meta keys.--manifest: location of manifest.json file. Usually target/manifest.json. This file contains a full representation of dbt project. Default: target/manifest.json--meta-keys: list of the required keys in the meta part of the test.--allow-extra-keys: whether extra keys are allowed. Default: False.
Example
-- as the last argument. Otherwise pre-commit would not be able to separate a list of files with args.
Requirements
1 It means that you need to run
dbt parse before run this hook (dbt >= 1.5).2 It means that you need to run
dbt docs generate before run this hook.
How it works
- Hook takes all changed
sqlfiles. - The manifest is scanned for a test.
- If any test (from a manifest or
sqlfiles) does not have specified meta keys, the hook fails. - The meta keys must be in either the yml file or the manifest.
run your test and then you delete meta keys from a properties file, the hook success since the meta keys is still present in manifest.json.
check-database-casing-consistency
What it doescompare Manifest and Catalog to ensure DB and Schemas have the same casing.When to use itIf you want to make sure your dbt project (Manifest) and database (Catalog) are db.schema consistent
--manifest: location of manifest.json file. Usually target/manifest.json. This file contains a full representation of dbt project. Default: target/manifest.json--catalog: location of catalog.json file. Usually target/catalog.json. dbt uses this file to render information like column types and table statistics into the docs site. In dbt-checkpoint is used for column operations. Default: target/catalog.json
Example
manifest vs catalog. If a db/schema in one of them presents a different casing, the hook fails.