-
Notifications
You must be signed in to change notification settings - Fork 53
Validate multiple input values in map task #334
Conversation
… for cache lookup Signed-off-by: Daniel Rammer <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #334 +/- ##
==========================================
+ Coverage 62.75% 64.05% +1.30%
==========================================
Files 146 146
Lines 12194 9890 -2304
==========================================
- Hits 7652 6335 -1317
+ Misses 3964 2976 -988
- Partials 578 579 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 129 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Daniel Rammer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, we're assuming here that if the inputs have lists, then the target function will take single elements... Right?
- what if the target function takes lists? Because they are considered static config values or something?
- Should we check the target interface and only take items from the list if it takes single items?
- I may have missed it (looking on my phone) do we need to update the compiler at all? (I don't think so)
Yeah, thanks for catching this. I will double-check because I know the flytekit PR had some minor issues supporting partials. But we should probably do a check here if this provided value type is castable to a
I do not believe so. |
All great questions, @EngHabu ! If I understand your question correctly, you're concerned about partial lists (i.e. tasks where we bound a parameter that's a list), correct? In that case, we made the decision to ship a version of partials that does not support that (in other words, you cannot have partial lists). We're making a change in flytekit to specifically catch that case. We're going to invest in the |
Thanks both for answering... @task
def my_task(a: str, b: typing.List[str]) -> int:
... Is any of these valid?
Then for this use case: @task
def my_task(a: str, b: str) -> int:
... Are these valid?
|
Answers inline.
case 1. is only going to work if the lists are of the same size.
Both should work. |
Just chatted offline with @eapolinario to understand more about the motivation for restricting partial lists... |
re-synced up on this. Currently a partial registers a new task with the expected
the maptask that is registered has the interface The decision in flytekit is to not allow lists to be passed as partials to functions (with this support added later). With this being said, I think this PR should be merged to add support for multiple lists in (1) validating equal length lists at runtime and (2) correctly setting cache keys. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense... Thank you
* validating multiple input values in map task and correctly populating for cache lookup Signed-off-by: Daniel Rammer <[email protected]> * added unit tests Signed-off-by: Daniel Rammer <[email protected]> --------- Signed-off-by: Daniel Rammer <[email protected]>
TL;DR
This PR adds support for caching over map tasks with multiple inputs and validates (at runtime) that each of the lists is the same length.
Type
Are all requirements met?
Complete description
^^^
Tracking Issue
NA
Follow-up issue
NA