https://prefect.io logo
Title
f

Federico Zambelli

04/14/2023, 7:55 PM
Guys, I don't understand how the tab
Task inputs
works. I followed this example here and I still don't get it. Can someone ELI5 it to me? I don't get how certain tasks show inputs, but others dont (see screens)
1
n

Nate

04/14/2023, 8:06 PM
hi @Federico Zambelli - this page shows, to quote the issue you referenced:
only relationships between tasks
so again going back to that issue's example
@flow()
def exampleflow():
    # Create some futures
    one = identity.submit(1)
    two = identity.submit(2)
    three = identity.submit(3)

    identity(one) # accepts 1 task result future -> will have 1 task input
    identity([two, three]) # accepts 2 task result futures -> will have 2 task inputs (looks like your first picture)
    identity(1) # accepts zero task result futures, will look like your second picture i.e. {x=[]}
    identity([2, 3]) # accepts zero task result futures, will look like your second picture i.e. {x=[]}
so basically, task "inputs" are references to upstream task results that are passed into the task you're looking at - does that make sense?
🙏 1
f

Federico Zambelli

04/14/2023, 8:12 PM
Ah yes that makes more sense. I was expecting that any input passed to the task args would show up. Thanks for the explanation!
I'm gonna ask maybe a provocative question: wouldn't it make more sense if it showed any input passed to the task? E.g. i have a task that parses a subreddit based on subreddit name and start and end date. But the parameters come from the flow, so the "task inputs" is always empty, ofc:
image.png
n

Nate

04/14/2023, 8:18 PM
at this time, we don't display the actual values of the task args - though that has definitely been many folks expectation of "Task Inputs" It gets a little tricky since many folks would not be comfortable surfacing task args plaintext in the UI for data sensitivity reasons - though yes, in some cases it would be more convenient than logging select values you'd like to see in the UI
f

Federico Zambelli

04/14/2023, 8:20 PM
It gets a little tricky since many folks would not be comfortable surfacing task args plaintext in the UI for data sensitivity reasons
ah this makes sense. thanks for the insights!
n

Nate

04/14/2023, 8:22 PM
i should actually be a little more explicit, and say that values passed to tasks are never even sent to the Prefect API, in contrast to flow parameters. here's a thread on this subject in the past where this is discussed
f

Federico Zambelli

04/14/2023, 8:23 PM
Got it, good to know. I have another question since you're here if you don't mind. When I write a task description, where is this supposedly shown in the web UI ? I can't find it anywhere
n

Nate

04/14/2023, 9:53 PM
hmm I don't believe we actually surface task descriptions in the UI
f

Federico Zambelli

04/15/2023, 9:28 AM
Ah alright, then I'm not sure I understand the purpose besides a regular docstring 😅.
n

Nate

04/16/2023, 1:05 AM
Let me get back to you on this! I think it'd make sense to surface task descriptions on the task run page, will discuss this with the team (seems this may have been alluded to here)
🙌 1