-
Notifications
You must be signed in to change notification settings - Fork 241
fix(validator): Forbidden rule does not support float #449
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
Conversation
funkyfuture
left a comment
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.
there must be at least tests covering the currently undesired behaviour (w/ the intended outcome).
| KEYSRULES = KEYSCHEMA = ErrorDefinition(0x83, 'keysrules') | ||
| VALUESRULES = VALUESCHEMA = ErrorDefinition(0x84, 'valuesrules') | ||
| BAD_ITEMS = ErrorDefinition(0x8f, 'items') | ||
| BAD_ITEMS = ErrorDefinition(0x8F, 'items') |
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.
that is an unnecessary change.
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 violates black reformatting rule in travis pipeline.
| elif isinstance(value, int): | ||
| if value in forbidden_values: | ||
| self._error(field, errors.FORBIDDEN_VALUE, value) | ||
| elif isinstance(value, 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.
please keep it simple. afaict, there's no need to branch off for float or integer values, only for container values that are not strings.
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.
I will look at it.
|
Closing in favour of #455. |
#436