-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return None type instead of exception #1907
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1907 +/- ##
=======================================
Coverage 54.71% 54.71%
=======================================
Files 305 305
Lines 22732 22737 +5
Branches 3453 3455 +2
=======================================
+ Hits 12438 12441 +3
- Misses 10122 10123 +1
- Partials 172 173 +1
☔ View full report in Codecov by Sentry. |
3a35541
to
06f46b2
Compare
flytekit/core/type_engine.py
Outdated
@@ -1090,6 +1090,16 @@ def get_sub_type(t: Type[T]) -> Type[T]: | |||
|
|||
raise ValueError("Only generic univariate typing.List[T] type is supported.") | |||
|
|||
@staticmethod | |||
def get_sub_type_or_none(t: Type[T]) -> Optional[Type[T]]: |
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.
I chose to add a new method because get_sub_type
is used in many places where they assume it never returns None
.
Not sure what happened to CI. The failure is not related to the change and it also happens to another PR. |
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.
We do not have support for list of unknown types- what does none mean?
06f46b2
to
b076da1
Compare
It is sort of unknown due to lack of python interface. The use case is
DictTransformer handles this by returning None , so the type will be inferred by looking at the elements themselves flytekit/flytekit/core/promise.py Line 615 in 1b5692a
As flyteorg/flyte#4270 describes, binding currently does not work for list type in a remote entity. |
Signed-off-by: Hongxin Liang <[email protected]>
b076da1
to
30a25f1
Compare
Hi. Can someone take a look at this PR again? Thank you. |
Thanks for fixing this, was about to open a PR to address it. Nice to see its already on main! |
Signed-off-by: Hongxin Liang <[email protected]> Signed-off-by: Rafael Raposo <[email protected]>
TL;DR
Return None type instead of exception for list subtype
Type
Are all requirements met?
Complete description
More details in flyteorg/flyte#4270
Tracking Issue
Fixes flyteorg/flyte#4270
Follow-up issue
NA