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

George Pearse

06/08/2022, 10:43 AM
I'm surprised that the config schema doesn't have an options parameter for things like:
Copy code
options=['initial_insert', 'update']
or
Copy code
options=['raw','target']
So that you would have the config schema validation fail (or provide suggestions) before you have to raise a ValueError within a pipeline, unless I'm missing something?
1
Also confused by why this is the case?
Copy code
Description: required arguments should not specify default values
Ideally I want this, which feels like it'd be a very common style of validation?
Copy code
'run_type': Field(str, 
        description='Insert type of the pipeline run, e.g. update or initial_insert', 
        options=['update','initial_insert'], # TODO: not currently supported but surprised by that
        default_value='update',
        is_required=True),
j

johann

06/08/2022, 3:11 PM
Copy code
required arguments should not specify default values
This is because the default value applies when an argument is not provided, which can’t occur for required args
g

George Pearse

06/08/2022, 3:33 PM
Got ya, I thought the default value would pre-fill it, but I guess that comes from the yaml config.
j

johann

06/08/2022, 3:37 PM
I’m not sure I’m following your question around ‘options’- but I think it may match
Selector
? https://docs.dagster.io/_apidocs/config#dagster.Selector
1
g

George Pearse

06/08/2022, 3:45 PM
@johann looks perfect
24 Views