Qwame
12/07/2021, 5:14 PMresources:
environs:
config:
year: 2021
How can I tell dagster that when launching from the dagit UI, if no year config us passed, use 2020.
In my Python file, I have the job defined as
@job(resource_defs={"environs": make_values_resource(year=2020)}
def pipeline_job():
job_a(job_b)
The idea is to pass the default value in the job definition but I am getting errors.
However, when I do this, I don't get any errors:
@job(resource_defs={"environs": make_values_resource(year=int)}
def pipeline_job():
job_a(job_b)
Any help?prha
12/07/2021, 5:16 PMdefault_value
argument when you define the resource config schema. Can you share the body of make_values_resource
?Qwame
12/07/2021, 5:17 PMmake_values_resource(year=int)
Do I have to define make_values_resource
elsewhere other than what I have in the code?prha
12/07/2021, 5:19 PMmake_values_resource
looks like a resource factory function that defines a resource definition using @resource
. Usually you can provide that definition with a config schema and provide a default value thereQwame
12/07/2021, 5:19 PMprha
12/07/2021, 5:20 PMResources
section on our docs site: https://docs.dagster.io/concepts/resourcesResource Configuration
year
be a https://docs.dagster.io/_apidocs/config#dagster.FieldQwame
12/07/2021, 5:24 PMop
instead of a job
?make_values_resource(year=Field(int, default_value=2020, is_required=False) )
Correct?Field
like I have in the code above solved it for me. Thanks!