Hi Everyone, I am getting below error when i execu...
# ask-community
s
Hi Everyone, I am getting below error when i executed my dbt dagster job , pls suggest where I'm going wrong I have procided my source code as well
o
hi @S N V C Sridevi Jaddu, dbt_run_op and dbt_test_op are ops themselves, so they should not be executed inside of another op. Ops should be combined inside of jobs (so you can just remove the my_dbt_op and put the
dbt_run_op(start_after=...)
inside my_dbt_cli_job
s
well got my mistake Thank you @owen I had one more query in the below code snippet from where the get_one is getting context from because i don't see while calling we have passed any context to it
o
yeah dagster sort of "magically" creates that context argument for you when it actually runs the code. The code under the job doesn't execute anything, it just defines the dependencies between your different operations. when the ops actually run, the dagster framework will create the context argument and pass it in in all the right places
s
@owen Could you pls help me in understanding below highlightes code snippet what does the highlighted code do exactly
o
it requires that you supply the job that this op lives in with a resource called "snowflake", and then ensures that the context object that dagster creates will have that snowflake resource available to it (so you can do
context.resources.snowflake...
)
s
@owen Thank you for the clear explanation i have defined my dbt snowflake job as below but when i'm reloading my workspace in dagit with below file I'm getting error
o
you should comment out the execute_in_process call (or wrap it in a "`if name == "main"`" type of thing). otherwise your job will be run everytime dagit tries to load the structure of your job
s
oh ok got it
Thank you @owen
1