Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check-model-name-contract support for snapshots #183

Open
ryancollingwood opened this issue Feb 1, 2024 · 1 comment
Open

check-model-name-contract support for snapshots #183

ryancollingwood opened this issue Feb 1, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ryancollingwood
Copy link

What:

Assuming we consider snapshots equivalent to models for checks purposes then this would be an extension to check-model-name-contract, otherwise it would be a new check something along the lines of check-snapshot-name-contract.

The behaviour would be as implemented for check-model-name-contract:

  • On a given directory path
  • Find all of the snapshot names (not the filename, but the name of the snapshot as it will be materialised)
  • Evaluate if any of them do not match a given regex
  • Return 0 on all snapshot names matching, Return 1 if one or more do not pass the regex test

Why

So that I can enforce a convention that all tables that are materialised using the dbt snapshot mechanism follow a convention which makes them easily identifiable - e.g. .*_snapshot

@ryancollingwood ryancollingwood added the enhancement New feature or request label Feb 1, 2024
@ryancollingwood
Copy link
Author

Had a go at implementing it: #184

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant