https://prefect.io logo
Title
b

Brad

05/16/2020, 12:41 AM
Hi team, I’m just playing around with the new result class; it looks really nice so far! Would it be possible to pass the inputs to the read/write functions also? I’d like to parameterise my filenames/targets per input. And another question, according to the docs these results are persisted to the prefect database, should I expect to see this table in the GraphQL api ?
c

Chris White

05/16/2020, 12:50 AM
Hey Brad! All great questions; there isn’t a first-class way to parametrize by inputs but I think that’s a reasonable request — if you open an issue for it we can take a look at how to support that! The biggest caveat will be that some input string representations won’t work well with filename templating but we can put some reasonable constraints on that
To extract the result locations from the GraphQL API right now is a little messy, but if you query for the
serialized_state
attribute of a task run you should be able to find the info you’re looking for. We’re going to make that more convenient in the very near future (along with better UI representations of results)
🎊 1
And actually you just reminded me I should announce the 0.11 release in #announcements !
b

Brad

05/16/2020, 12:55 AM
Re point 1 - Yep agreed not every input will have a good str repr, but if it does the user has the choice to include it.
obviously if you try and template a random object

https://www.autodesk.com/products/fusion-360/blog/wp-content/uploads/2016/09/youre-gonna-to-have-a-bad-time.jpg

😂 1
What I’ve actually been doing is taking the module path + task name + hash of the cloud-pickled inputs to make a unique but deterministic filename
which works quite well
(if you have for example, multiple flows/users using common tasks)
c

Chris White

05/16/2020, 1:00 AM
i’m impressed by how quickly you’re exercising that API! I love it
b

Brad

05/16/2020, 1:00 AM
but this requires the new Result class to pass the inputs through
c

Chris White

05/16/2020, 1:00 AM
yea
yea definitely open an issue; it can be our first enhancement on the API 😄
b

Brad

05/16/2020, 1:01 AM
doing it as we speak
💯 1
c

Chris White

05/16/2020, 1:09 AM
awesome i appreciate it