Last active
May 20, 2020 21:38
-
-
Save helloworld/a5beae21bfa32050fbc2787e2833c65e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dagster import pipeline, solid, RepositoryDefinition, InputDefinition, execute_pipeline, DagsterInstance | |
@solid(input_defs=[InputDefinition("number", int)]) | |
def process(context, number): | |
context.log.info("Number: {}".format(number)) | |
@solid | |
def root(context): | |
numbers = [1, 2, 3, 4, 5] | |
for number in numbers: | |
execute_pipeline(process_number, instance=DagsterInstance.get(), environment_dict={ | |
'solids': { | |
'my_solid': { | |
'inputs': { | |
'number': number | |
} | |
} | |
} | |
}) | |
@pipeline | |
def root_pipeline(): | |
root() | |
@pipeline | |
def process_number(): | |
process() | |
def define_repository(): | |
return RepositoryDefinition("my_repository", pipeline_defs=[root_pipeline, process_number]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment