Skip to content

Question about parametising reusable solid #3243

Answered by schrockn
gherka asked this question in Q&A
Discussion options

You must be logged in to vote

You might want to try configured, which allows you to curry in config values into a solid definition:

from dagster import pipeline, solid, execute_pipeline


@solid(config_schema={"string": str})
def print_thing(context):
    context.log.info(f"the string: {context.solid_config['string']}")


@pipeline
def pipe():
    print_thing.configured({"string": "foo"}, name="print_foo")()
    print_thing.configured({"string": "bar"}, name="print_bar")()


execute_pipeline(pipe)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by gherka
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants