https://dagster.io/ logo
#dagster-feedback
Title
# dagster-feedback
s

Stephen Bailey

05/11/2022, 1:42 PM
I find myself doing order-based dependencies on occasion, where I have to do some sort of environment manipulation -- like, write an SSH key to file in the container, or populate an environment variable. In Prefect, there's a built-in function that you can do called
depends_on
, and it operates basically like an always-present Nothing input, a la --
@op(ins={"depends_on": In(Nothing)})
, which you can pass a list of outputs from other ops to. Anyway, suggestion would be to do the same thing in Dagster to make order-based dependencies really intuitive to implement:
Copy code
@op
def set_up_env_op():
    pathlib.Path("foo").write_text("bar")
    return True

@op
def run_main_op()
    print("something that depends on the first thing being done.")

@job
def my_job():
    done = set_up_env_op()
    run_main_op(depends_on=[done])
👍 3
m

Mark Fickett

05/11/2022, 2:52 PM
Yes, it would be nice not to have to declare the
start
input explicitly, and just always have it as an option.
y

yuhan

05/12/2022, 8:01 PM
@Dagster Bot issue Consider to accept a list of upstream outputs for Nothing dependency
d

Dagster Bot

05/12/2022, 8:01 PM
y

yuhan

05/12/2022, 8:03 PM
I think it’s a great idea - filing an issue for tracking this feature request!
ty thankyou 1