Is there a good way to set a predefined prefect ta...
# prefect-community
p
Is there a good way to set a predefined prefect task to have an upstream dependency? I would like the sql_task to wait on the password, but that's got the graph that I'm getting.
Copy code
sql_task = SqlServerFetch(
        db_name=prefect.config.sql_server.database,
        user=prefect.config.sql_server.user,
        host=prefect.config.sql_server.server,
        query=get_manual_override_rows,
        fetch='many',
        fetch_count=3,
        result=result_formatter,
        name="Database Query"
        # commit: bool = False,
)

with Flow("config_flow") as f:

    mode = Parameter("Mode", default="dev")

    password_var  = set_creds(mode)
    password_task = EnvVarSecret()
    password = password_task(password_var)
    s = sql_task(password=password)

    v = view_sql(sql_task)
j
I think you want to pass
s
to
view_sql
, not
sql_task
.
1
p
I probably should have caught that 😅. Thank you!
j
No worries, this is a not-uncommon confusion in prefect.