-
Notifications
You must be signed in to change notification settings - Fork 219
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
Empty lists behaving incorrectly #397
Comments
ChristopherChudzicki
added a commit
to ChristopherChudzicki/mitx-grading-library
that referenced
this issue
Jun 27, 2019
Mostly these have to do with validation of default inputs. Also, alecthomas/voluptuous#397, which I assume is a bug
That seems like a bug. |
monopolis
added a commit
to monopolis/voluptuous
that referenced
this issue
Oct 12, 2020
The behaviour seems to have been introduced in commit 95489bd that modified the schema of an empty list in order to provide a consistent behaviour between Schema({}) and Schema([]). The commit introduced an enumeration of the incorrect values rather than the expected behaviour of showing the key with the incorrect value. This commit provides the expected behaviour, and is also consistent with the 'pathless' behaviour currently implemented, meaning that - Schema([])([1]) -> 'not a valid value @ data[1]' - Schema({'key': []})({'key': [1]) -> 'not a valid dictionary value @ data['key']. Finally, as new unit test is provided to ensure that the new behaviour remains intact.
spacegaier
pushed a commit
that referenced
this issue
Dec 6, 2020
* Add ability to use custom flags when running tox .. so that you can e.g. run `tox -- --pdb` to get a debugger on test failures. * Remove value enumeration when validating empty list (#397) The behaviour seems to have been introduced in commit 95489bd that modified the schema of an empty list in order to provide a consistent behaviour between Schema({}) and Schema([]). The commit introduced an enumeration of the incorrect values rather than the expected behaviour of showing the key with the incorrect value. This commit provides the expected behaviour, and is also consistent with the 'pathless' behaviour currently implemented, meaning that - Schema([])([1]) -> 'not a valid value @ data[1]' - Schema({'key': []})({'key': [1]) -> 'not a valid dictionary value @ data['key']. Finally, as new unit test is provided to ensure that the new behaviour remains intact.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We're in the process of upgrading from version
0.10.5
to version0.11.5
, and empty list validation is now giving strange errors:The error message doesn't make sense to me...there is no dictionary with key
'x'
.The text was updated successfully, but these errors were encountered: