Flyte Team, I have been working on using `FlyteRem...
# flytekit
a
Flyte Team, I have been working on using
FlyteRemote
and now I understand how to ask my question lol. My remote workflow looks like this:
Copy code
@dataclass_json
@dataclass
class WrappedList:
    s: str

@flytekit.workflow
def count_files_test_workflow(
    in: WrappedList,
):
How do I call this workflow with
FlyteRemote
? If I try to do:
Copy code
remote = FlyteRemote(...)
lp = remote.fetch_launch_plan(...)
remote.execute(lp, inputs={'in': WrappedList("foo")})
Then I get
FlyteTypeException: Type error! Received: <class '__main__.WrappedList'> with value: WrappedList(s='foo'), Expected: <class 'types.WrappedlistSchema'>
. I looked into the
type_hints
argument to
remote.execute
, but I don't think that's the right thing here. What I really need to be able to do is specify
inputs={'in': x}
where x is an instance of types.WrappedListSchema.
👀 1
types.WrappedListSchema
comes from the flytekit type engine and transformers, etc. that gets a bit complicated quickly. I'm not sure what to call to transform my
WrappedList("foo")
value into a
types.WrappedListSchema
instance (that is part of the remote interface).
Sorry, I asked this yesterday in #general but my question wasn't very clear. At least now I can state exactly what I'm trying to accomplish (FYI @Yee)
k
looking
k
Alex can you try to print the lp.interface
e
@Alex Bain, you should be able to schedule an execution by specifying the type hints in the call to
execute
, like so:
Copy code
remote.execute(lp, inputs={'in': WrappedList("foo")}, type_hints={'in': WrappedList})
165 Views