-
Notifications
You must be signed in to change notification settings - Fork 135
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
Can't do per-target variables easily #52
Comments
To resolve this, I propose supporting more specific names, eg. "ga4_dataset" instead of "dataset". We can fall back to the current variables, which are fine for people who only have one set of values for all targets. Sound OK? |
Oh, I'm wrong, we can use env_var in dbt_project, just not call project-defined stuff. My bad. |
Ah no, that is only for |
Even better would be to use env_var as the fallback in the var() calls. But that's not particularly standardised. Thoughts? |
This is a good call-out. Can you post this Q to the DBT package ecosystem Slack channel first to get input? Seems like we can't be the only group that has run into this issue. There is also a Jan 2023 plan to address project namespaces: https://github.com/dbt-labs/dbt-core/blob/main/docs/roadmap/2022-05-dbt-a-core-story.md |
We have separate GA4 instances for our test & prod sites, which therefore have different property IDs, resulting in different BQ dataset names (in different GCP projects in our case).
The docs say to configure "using the following variables which must be set in your dbt_project.yml file."
But dbt_project.yml doesn't support variables itself, and so the normal pattern is to override these on a per-environment basis using --vars arguments.
However, --vars defines the variables in the global namespace, not ga4. For example, if we use a command like:
The variables don't get used, as they're nested under "ga4", rather than being un-nested and presented only to the ga4 module:
We can pass them without the ga4 nesting:
But then these variables are fully global and potentially conflict with other variables used in the project (eg.
start_date
in particular).The text was updated successfully, but these errors were encountered: