-
Notifications
You must be signed in to change notification settings - Fork 180
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 seem to inject vars via operator_args #544
Comments
HI @set5think , thanks for posting the issue! Have you tried the following: https://astronomer.github.io/astronomer-cosmos/configuration/operator-args.html? Please give a step-by-step for us to reproduce the issue. |
Hi, I have the same issue. I can reproduce it with DBT_LS load mode.
I get:
With DBT_MANIFEST, it works fine. Also, if I set the var in the *Well, I have the time-out issue mentioned here: #520 (comment), but no more var-related issues. I'm on Cosmos 1.2.1 / dbt-core 1.5.4, on Google Cloud Composer, local execution mode. |
@fabiomx The issue is that the operator args is only used during task execution, not DAG parsing. To solve the issue you described, we'll need to add vars to the Since you're not blocked ( |
…tronomer#735) ## Description Currently users have to specify environment variables in both `RenderConfig` and `operator_args` for the dbt dag so that they're used during rendering and execution. dbt variables cannot currently be used in rendering, only during execution in `operator_args`. This PR exposes `env_vars` and `dbt_vars` in `ProjectConfig` and uses the dbt variables in dbt ls load mode. Updates in this PR: - Deprecates `operator_args` "env" and "var", raising warnings that they will be removed in Cosmos 2.x - Deprecates `RenderConfig.env_vars` raising warnings that it will be removed in Cosmos 2.x - Adds both `dbt_vars` and `env_vars` within `ProjectConfig` - dbt variables are used in dbt ls load method - Raises an exception if **both** operator_args and ProjectConfig variables are used. - Updates docs and example DAGs to use ProjectConfig args. ## Related Issue(s) Closes astronomer#712 Closes astronomer#544 ## Breaking Change? None ## Checklist - [x] I have made corresponding changes to the documentation (if required) - [x] I have added tests that prove my fix is effective or that my feature works --------- Co-authored-by: Tatiana Al-Chueyr <tatiana.alchueyr@gmail.com>
Hi, I'm running cosmos 1.1.1, and am reading the docs and code, and am using basically the same code minus values, but no matter what I do, the dbt command is never generates with the dbt vars I pass through operator_args. When I inspect cosmos/graph.py, I don't see where operator_args is ever used to inject settings from it into the dbt the command. I only see it to populate a class called
LegacyDbtProject
and then just in the class signature.Is there a different way to inject dbt vars not using operator_args?
Thanks,
-Hassan
The text was updated successfully, but these errors were encountered: