hey Dagster Support, I am stuck on trying to conso...
# ask-community
l
hey Dagster Support, I am stuck on trying to consolidate the resource for a job and conversion of the graph to job, below is the job I am trying to create:
Copy code
@job(
    resource_defs={
        "news_loader": news_loader,
        "start_date": make_values_resource(),
        "end_date": make_values_resource(),
    },
)
def daily_data_download_job():
    daily_data_download_graph.to_job(resource_defs={"news_loader": news_loader,
                                                    "start_date": make_values_resource(),
                                                    "end_date": make_values_resource()})
In my job, is there a way to pass the
start_date
from resource_defs to the argument of
to_job()
? I try to use context, but it seems like context is not supported by job.
c
are you trying to call
<http://daily_data_download_graph.to|daily_data_download_graph.to>_job
within
daily_data_download_job
? If so, that’s incorrect syntax. All you should need to do is create the job from the graph like you are doing in the call to to_job. This is all you should need:
Copy code
my_job = daily_data_download_graph.to_job(resource_defs={"news_loader": news_loader,
                                                    "start_date": make_values_resource(),
                                                    "end_date": make_values_resource()})
l
Much appreciated, this works! @chris
blob thumbs up 1