https://dagster.io/ logo
k

King Chung Huang

07/25/2019, 11:23 PM
When declaring a pipeline, can I also set some config values on solids? For example, with the following solid and pipeline, can I set the value of the
prefix
config to something like
_foo_
as part of the pipeline, and still optionally set it via the environment when executing the pipeline?
Copy code
@solid(
    config={'prefix': Field(str, is_optional=True, default_value='_')}
)
def prefix_value(context, v):
    return f'{context.solid_config["prefix"]}{v}'

@pipeline
def test_normalize():
    prefix_value.alias('prefix_foo')() # set prefix to _foo_ somehow?
    prefix_value.alias('prefix_bar')() # and, set prefix to _bar_ somehow?
s

schrockn

07/27/2019, 10:30 PM
We don’t currently support this but I actually think this is a really interesting idea.
We could support this with a mechanism similar to the “config_mapping” mechanism on composite_solids