#1703 Union | optional return types supported
Pull request opened by
kumare3
TL;DR
Union types iterate through all variants to find the right fit. The incorrect fit should raise an error to prevent the wrong cast.
Prior to the PR certain type transfomers (like None Type), tranform without considering if the python object is acceptable or matches the type. In the case of protobuf supported types like int, string, float etc, doing an implicit conversion will raise a runtime error, but for transformers like pickle or none type, this is leads to incorrect behavior.
This is because,
• none values can be pickled
• none type in flyte is actually just an assignment and disregards the actual value.
Type
☑︎ Bug Fix
☐ Feature
☐ Plugin
Are all requirements met?
☑︎ Code completed
☑︎ Smoke tested
☑︎ Unit tests added
☑︎ Code documentation added
☑︎ Any pending items have an associated Issue
This should fix the following
fixes
flyteorg/flyte#3319
flyteorg/flytekit
✅ All checks have passed
30/30 successful checks