Skip to content

Instantly share code, notes, and snippets.

@aherbst-broad
Last active June 2, 2021 18:11
Show Gist options
  • Save aherbst-broad/1c08a76d61055bb5dab9491aec3f75ea to your computer and use it in GitHub Desktop.
Save aherbst-broad/1c08a76d61055bb5dab9491aec3f75ea to your computer and use it in GitHub Desktop.
@solid
def upstream_returning_nothing() -> Nothing:
pass
@solid
def upstream_returning_string() -> str:
return "something else"
@solid(
input_defs=[InputDefinition("start", Nothing),
InputDefinition("bar", String)]
)
def downstream_consuming_string(bar: str):
pass
@pipeline
def nothing_dependency_pipeline():
real_string = upstream_returning_string()
downstream_consuming_string(upstream_returning_nothing(), real_string)
execute_pipeline(nothing_dependency_pipeline)
@alangenfeld
Copy link

from dagster import (
    composite_solid,
    pipeline,
    solid,
    InputDefinition,
    Nothing,
    String,
    execute_pipeline,
)


@solid
def upstream_returning_nothing() -> Nothing:
    pass


@composite_solid
def upstream_composite_returning_nothing() -> Nothing:
    return upstream_returning_nothing()


@solid
def upstream_returning_string() -> str:
    return "something else"


@solid(input_defs=[InputDefinition("start", Nothing), InputDefinition("bar", String)])
def downstream_consuming_string(bar: str):
    pass


@composite_solid(input_defs=[InputDefinition("bar", String), InputDefinition("start", Nothing)])
def downstream_composite(bar: str, start: Nothing):
    downstream_consuming_string(bar, start=start)


@pipeline
def nothing_dependency_pipeline():
    real_string = upstream_returning_string()
    downstream_composite(real_string, start=upstream_composite_returning_nothing())


execute_pipeline(nothing_dependency_pipeline)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment