Conversation
izeigerman
reviewed
Aug 22, 2025
| select 1 | ||
| """) | ||
|
|
||
| result = invoke_cli(["list", "--vars", "foo: bar"]) |
Collaborator
There was a problem hiding this comment.
Do we need to test more variances like:
$ dbt run --vars '{"key": "value", "date": 20180101}'
$ dbt run --vars '{key: value, date: 20180101}'
or are we confident that the YAML parser takes care of it?
Collaborator
Author
There was a problem hiding this comment.
The YAML parser does indeed take care of it, but I added a test test_yaml_param_type() to prove it
izeigerman
reviewed
Aug 22, 2025
| raise ValueError(f"Unexpected click context object: {type(ctx.obj)}") | ||
| return ctx.obj | ||
|
|
||
| dbt_operations = ctx.obj(vars=vars) |
Collaborator
There was a problem hiding this comment.
Why do we handle this differently from profile / target`?
Collaborator
Author
There was a problem hiding this comment.
--profile / --target are top level dbt options - they show in dbt --help and apply to every subcommand.
--vars only applies to certain subcommands. eg it shows in dbt list --help and dbt run --help but not dbt source --help
0324699 to
c5cda03
Compare
izeigerman
approved these changes
Aug 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for the
--vars '<yaml blob>'syntax of the dbt core cli.It passes these in
config_loader_kwargsso the variables are available before the project is loaded