-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
The Enum DataType currently doesn't have its own validate function, so it uses the default default parent validation which errors if not isinstance(value, self.dtype). This means if I have an enum like
Class MyEnum(Enum):
MY_VAL = "Val"
then the only values that are accepted when doing a put into an attribute of this type are instances of this enum. For instance, I can do await attr.set(MyEnum.MY_VAL), but not `await attr.set("Val").
It would be useful to extend this validation so that we can set these attributes to their enum values.
Acceptance Criteria
- Add a validation function to the enum datatype to allow enum members to be used in the
set - No breaking changes occur - you can still use
setwith enum instances as before
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels