https://dagster.io/ logo
#ask-community
Title
# ask-community
s

S N V C Sridevi Jaddu

03/29/2022, 4:40 PM
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

owen

03/29/2022, 4:42 PM
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

S N V C Sridevi Jaddu

03/29/2022, 4:46 PM
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

owen

03/29/2022, 4:48 PM
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

S N V C Sridevi Jaddu

03/29/2022, 5:00 PM
@owen Could you pls help me in understanding below highlightes code snippet what does the highlighted code do exactly
o

owen

03/29/2022, 5:02 PM
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

S N V C Sridevi Jaddu

03/29/2022, 5:21 PM
@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

owen

03/29/2022, 5:24 PM
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

S N V C Sridevi Jaddu

03/29/2022, 5:25 PM
oh ok got it
Thank you @owen
1
3 Views