Skip to content
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

[TypeTransformer] Support non-Any Python types as Any input in workflows #2432

Closed
wants to merge 18 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
Signed-off-by: Future-Outlier <eric901201@gmail.com>
  • Loading branch information
Future-Outlier committed May 25, 2024
commit 449a1c74559db79ac1dc9ef58ad27a658d62b9c1
7 changes: 2 additions & 5 deletions flytekit/types/pickle/pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def to_python_value(self, ctx: FlyteContext, lv: Literal, expected_python_type:
return FlytePickle.from_pickle(uri)
except Exception as e:
from datetime import datetime, timedelta

if lv.scalar:
if lv.scalar.primitive:
if lv.scalar.primitive.integer:
Expand All @@ -107,11 +108,7 @@ def to_python_value(self, ctx: FlyteContext, lv: Literal, expected_python_type:
return TypeEngine.to_python_value(ctx, lv, datetime)
elif lv.scalar.primitive.duration:
return TypeEngine.to_python_value(ctx, lv, timedelta)
return None
print("expected_python_type: ", expected_python_type)
print(f"Failed to convert value from pickle {e}")
# return None
return TypeEngine.to_python_value(ctx, lv, int)
raise e

def to_literal(self, ctx: FlyteContext, python_val: T, python_type: Type[T], expected: LiteralType) -> Literal:
if python_val is None:
Expand Down