-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUGFIX] argilla
: prevent enum literal validation errors
#5679
[BUGFIX] argilla
: prevent enum literal validation errors
#5679
Conversation
@@ -122,13 +121,12 @@ def __init__( | |||
super().__init__(client=client) | |||
|
|||
try: | |||
settings = TermsMetadataPropertySettings(values=options, type=MetadataPropertyType.terms) | |||
settings = TermsMetadataPropertySettings(values=options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need the type here anymore. Each setting instance defines its type.
except ValueError as e: | ||
raise MetadataError(f"Error defining metadata settings for {name}") from e | ||
|
||
self._model = MetadataFieldModel( | ||
name=name, | ||
type=MetadataPropertyType.float, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type is redundant. Model should use the one defined under the settings
attribute
argilla
: prevent enum literal validationsargilla
: prevent enum literal validation errors
Description
In some environments, working with enun instances as string values may lead to some validation errors. See this discord discussion.
This PR reviews how metadata settings classes are defined, and defines type directly as a literal string, in the same way we do fo questions or fields, instead of using the MetadataPropertyType class.
Type of change
How Has This Been Tested
Checklist