-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[CT-3268] [Bug] dbt deps fails if a var is not defined #8913
Comments
Thanks for opening and including relevant links @darist ! I haven't researched why Have you found any workarounds? One workaround that would be worth trying: dbt deps --vars '{my_dataset: }' |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers. |
1 similar comment
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers. |
@dbeatty10: Would love to see this reopened, as mentioned in #10829. The workaround provided does not work in dbt Cloud as the And either way, installing package dependencies should have nothing to do with project variables (as opposed to running the packages later on). Maybe packages have their own variables, but that should have nothing to do with the variables defined in my project. Although I see now that some packages do require project-level variables/configurations. But once again, those variables should be for the execution of the package, not for its installation. It would be nice to see a fix for this, just like it was also fixed for env vars in #2368, and for profiles in #4554. |
@mroy-seedbox re-opening per request! Thank you for your research on the other related issues 🤩 Labeling this issue as In the meantime, you could try providing a dummy default value: models:
foo:
+dataset: "{{ var('my_dataset', 'ideally something that would raise an error if actually used') }}" |
Yeah, we are using default values as a workaround for now. But the whole idea is to make certain variables mandatory, so ideally they should not have a default. And since those variables as used in multiple places, raising an error is not ideal (as it would also have to be checked/copy-pasted in multiple places). 😞 |
Is this a new bug in dbt-core?
Current Behavior
Where
my_dataset
is a var used in mydbt_project.yml
without a default value, eg:Expected Behavior
Expected
dbt deps
to succeed in bringing the dependencies to the dbt_packages folder even if I didn't pass any--vars
Based on the description at https://docs.getdbt.com/reference/commands/deps, I did not expect it to try to parse my model configs in my dbt_project.yml.
Steps To Reproduce
see current behavior
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
bigquery
Additional Context
This is similar to: #2368, but looks like the fix for it focused on the
profiles.yml
file.Why does it matter?
We build docker images of our dbt projects to run in production. We want the deps already pulled in in the image so that we can just
dbt run --vars ...
in production. The values of these vars are not known at docker-image build time. We still want no default values for the vars so that adbt run
without required--vars
fails early.The text was updated successfully, but these errors were encountered: