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

investigate methods to ensure models exist #32

Open
dave-connors-3 opened this issue May 8, 2023 · 1 comment
Open

investigate methods to ensure models exist #32

dave-connors-3 opened this issue May 8, 2023 · 1 comment

Comments

@dave-connors-3
Copy link
Collaborator

right now, for model contracts, we rely on the catalog.json artifact for column information. Using the artifact assumes that the models exist in the environment we're running the package in, and can lead to some issues if the models do not yet exist.

This is a challenge to manage when

  • Models are renamed with the version operation (fix: do any contract operations first)
  • Users have not run a whole dbt run in dev before attempting to use this package.

Should we think about some sort of dry-run mode to stub in metadata only models before all ops (select * from ... where false)? Is it more reliable to leverage the get_columns_in_query macro, perhaps as a run operation?

@b-per
Copy link
Contributor

b-per commented Jun 8, 2023

Would another option be to allow "importing" a catalog.json that was generated from prod?

Or, to try the technique of ... where false, could we overwite the ref function to replace ref("my_model") by ( select * from ref("my_model") where false )

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

No branches or pull requests

2 participants