-
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-898] [Feature] Make entire dbt invocation command available to Jinja context #5524
Comments
I think what we want here is just good old Lines 630 to 636 in 94a7cfa
That's what we use in the I think this could quite naturally land as a property or method in the @contextproperty
def invocation_args_dict(self):
from dbt.utils import args_to_dict # not here, of course
return args_to_dict(self.config.args)
Note that the exact structure of the args dict is definitely liable to change, as we rework our CLI to use |
@jtcohen6 I've had a go at implementing this and I'm at the stage of trying to add the required tests. Are you able to provide some direction on how tests for the ProviderContext should be implemented? |
Is this your first time opening an issue?
Describe the Feature
Right now
flags.WHICH
can be used to return the top-level command, but it would be great to surface the entire command string of args, flags, vars etc. The use case here is the dbt_artifacts package's https://github.com/brooklyn-data/dbt_artifacts/blob/main/models/fct_dbt__invocations.sql model.Even better would be to also make each section of the command accessible separately, such as the selector, any args, flags etc.
Describe alternatives you've considered
No response
Who will this benefit?
No response
Are you interested in contributing this feature?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: