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

Different target environments - workaround #13

Open
sisu-callum opened this issue Apr 20, 2021 · 1 comment
Open

Different target environments - workaround #13

sisu-callum opened this issue Apr 20, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@sisu-callum
Copy link

When trying to figure out how I'd create the LookML files for production environments as opposed to development, I realized that this process is built off the artifacts. So all you need to do is overwrite the artifacts with the correct information and then re-run. This workaround is dbt docs generate --target production and then run dbt2looker. It creates the LookML that references the right DB's and Schema's.

This still introduces issues when creating new models that are not materialized in the production environment. I wonder if there is a better way to parse through the manifest and then replace the schema and database references. The issue is that these are generated at runtime in dbt. So not sure how to best handle this one.

@owlas
Copy link
Collaborator

owlas commented Apr 23, 2021

Hey @sisu-callum - this is a great idea! I hadn't thought about it. The reason we need the materialised views is to get all the column types (we can substitute the database and table in prod no problem).

But actually when pushing to production, we should already have locked in these types when materialising the dev tables.

I'm thinking either:

  • We live with the work around dbt run --target production && dbt docs generate --target production && dbt2looker
  • Or we come up with a lighter "prod" run that takes a lot of the templated lookml from the most recent "dev" run

Not sure what that second option would look like yet

@owlas owlas added the enhancement New feature or request label Apr 23, 2021
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

2 participants