astonishing-lizard-78628
05/18/2022, 8:10 AMFlyteRemote
to execute a workflow launch plan where one of the parameters is my custom class (assume that I have a good reason why I want to do this). For example, I have:
@dataclass_json
@dataclass
class WrappedList:
files: str
and the workflow
@flytekit.workflow
def LocalSlam(input_list: WrappedList)
and that I want to use FlyteRemote
to execute this worklow like
lp = remote.fetch_launch_plan(name=workflow_name, version=workflow_version)
e = remote.execute(lp, inputs=inputs)
astonishing-lizard-78628
05/18/2022, 8:15 AMinputs
for this custom class, e.g. if I have:
inputs = {'input_list': WrappedList("foo")}
and I run this code I get: flytekit.common.exceptions.user.FlyteTypeException: Type error! Received: <class '__main__.WrappedList'> with value: WrappedList(files='foo'), Expected: <class 'types.WrappedlistSchema'>.
astonishing-lizard-78628
05/18/2022, 8:16 AMWrappedList
class type and the remote types.WrappedlistSchema
that it registered for my classastonishing-lizard-78628
05/18/2022, 8:17 AMremote.execute
takes type_hints
, but I'm stuck on 0.26.0 for this repo so I can't use that argument (which isn't in that 0.26.0)astonishing-lizard-78628
05/18/2022, 8:19 AMtypes.WrappedlistSchema
type and passing it into remote.execute
?astonishing-lizard-78628
05/18/2022, 8:26 AMinput_list
workflow parameter (from the launch plan):
defaultInputs:
parameters:
input_files:
default:
scalar:
generic:
files: ""
var:
description: input_files
type:
metadata:
$ref: '#/definitions/WrappedlistSchema'
$schema: <http://json-schema.org/draft-07/schema#>
definitions:
WrappedlistSchema:
additionalProperties: false
properties:
files:
title: files
type: string
type: object
simple: STRUCT
astonishing-lizard-78628
05/18/2022, 8:41 AMremote.execute
...thankful-minister-83577
thankful-minister-83577
thankful-minister-83577
type_hints
named argthankful-minister-83577