Daniel Kim
12/03/2020, 1:49 PMfrom dagster import (
execute_pipeline,
pipeline,
solid
)
@solid
def get_name(_, plant_code: str):
print(f"Plant code: {plant_code}")
@solid
def hello(context, plant_code: str):
<http://context.log.info|context.log.info>('Hello, {name}!'.format(name=plant_code))
@pipeline
def hello_pipeline():
get_name()
hello()
if __name__ == "__main__":
run_config = {
"solids": {
"get_name": {"inputs": {"plant_code": {"value": "Plant1"}}},
"hello": {"inputs": {"plant_code": {"value": "Plant1"}}}
}
}
execute_pipeline(hello_pipeline, run_config=run_config)
# want to do something like this:
value = ["Plant1", "Plant2", "Plant3"]
for plant_code in value:
execute_my_pipeline(plant_code) etc...
I can create a pipeline for one plant code "Plant1", but let's say I want to execute this set of tasks in this pipeline for each additional plant code. With the run_config, not sure if it is possible to loop through a list of values passed into the "value" parameter. I hope my question makes sense. Any help is much appreciated!daniel
12/03/2020, 3:18 PMDaniel Kim
12/03/2020, 3:36 PMdaniel
12/03/2020, 3:38 PM