https://flyte.org logo
#flytekit
Title
# flytekit
a

Alex Bain

05/19/2022, 10:09 AM
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

Kevin Su

05/19/2022, 12:47 PM
looking
k

Ketan (kumare3)

05/19/2022, 1:41 PM
Alex can you try to print the lp.interface
e

Eduardo Apolinario (eapolinario)

05/19/2022, 7:04 PM
@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})
23 Views