-
Notifications
You must be signed in to change notification settings - Fork 145
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
Fix #262, where a default value of drop affects *de*serialization. #264
Conversation
Since issue references in titles don't turn into links, here's a reference that will: #262. |
# NOTE: This test fails--but what *should* it do | ||
# when a Sequence has a subnode with a default? | ||
# result = node.serialize([]) | ||
# self.assertEqual(result, ['abc']) |
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.
ISTM that node.serialize([])
should return the empty list: the default value for subnodes is only interesting if there are colander.null
values in the sequence to apply it to.
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.
Yes, but look at the MappingSchema
test at lines 3437-38:
result = node.deserialize({})
self.assertEqual(result, {'a':'abc'})
I'm not keen on the asymmetry.
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 agree with @tseaver that this should just return an empty list unless there is actually an item in the sequence, such as with colander.null
.
Anyone minding the store? |
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 decided to (finally) review this and I think it's good. I'd be happy to merge this for a feature release if the one outstanding test is fixed. If you can't be bothered please let me know and I'll take care of it.
Colander 2 introduced a extra argument to `colander.Mapping._impl` function (from Pylons/colander#264), which break the `OpenMapping` and `SortedOpenMapping` subclasses from colander-tools. This add the missing argument, as well as a couple of tests to know about it if it ever happen again.
Colander 2 introduced a extra argument to `colander.Mapping._impl` function (from Pylons/colander#264), which break the `OpenMapping` and `SortedOpenMapping` subclasses from colander-tools. This add the missing argument, as well as a couple of tests to know about it if it ever happen again.
Colander 2 introduced a extra argument to `colander.Mapping._impl` function (from Pylons/colander#264), which break the `OpenMapping` and `SortedOpenMapping` subclasses from colander-tools. This add the missing argument, as well as a couple of tests to know about it if it ever happen again.
Colander 2 introduced a extra argument to `colander.Mapping._impl` function (from Pylons/colander#264), which break the `OpenMapping` and `SortedOpenMapping` subclasses from colander-tools. This add the missing argument, as well as a couple of tests to know about it if it ever happen again.
Colander 2 introduced a extra argument to `colander.Mapping._impl` function (from Pylons/colander#264), which break the `OpenMapping` and `SortedOpenMapping` subclasses from colander-tools. This add the missing argument, as well as a couple of tests to know about it if it ever happen again.
Colander 2 introduced a extra argument to `colander.Mapping._impl` function (from Pylons/colander#264), which break the `OpenMapping` and `SortedOpenMapping` subclasses from colander-tools. This add the missing argument, as well as a couple of tests to know about it if it ever happen again.
* Bump colander from 1.8.3 to 2.0 Bumps [colander](https://github.com/Pylons/colander) from 1.8.3 to 2.0. - [Release notes](https://github.com/Pylons/colander/releases) - [Changelog](https://github.com/Pylons/colander/blob/main/CHANGES.rst) - [Commits](Pylons/colander@1.8.3...2.0) --- updated-dependencies: - dependency-name: colander dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Remove dead code after Pylons/colander#264 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Mathieu Leplatre <mathieu@mozilla.com>
No description provided.