Unanswered
Hi Everyone,
I Get An Error When I Add An Argument Of Type Enum To A Pipeline Component (@Pipelinedecorator.Component). At The Same Time Pipelines (@Pipelinedecorator.Pipeline) And Normal Functions Work Fine With Enums. The Error Message Looks Like This:
@<1643060801088524288:profile|HarebrainedOstrich43> you are right. we actually attempt to copy the default arguments as well. What happens is that we aggregate these arguments in the kwargs
dict, then we dump str(kwargs)
in the script of the pipeline step. Problem is, str(dict)
actually calls __
repr_
_
on each key/value of the dict, so you end up with repr(MyEnum.FALSE)
in your code, which is <MyEnum.FALSE: 'FALSE'>
. One way to work around this is to add something like:
class MyEnum(Enum):
FALSE = "FALSE"
TRUE = "TRUE"
def __repr__(self):
return str(self) # notice this
to your enum
107 Views
0
Answers
10 months ago
10 months ago