Skip to content
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

Merged
merged 4 commits into from
Jan 2, 2023

Conversation

michaellenaghan
Copy link
Contributor

No description provided.

@michaellenaghan
Copy link
Contributor Author

michaellenaghan commented May 27, 2016

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'])
Copy link
Member

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.

Copy link
Contributor Author

@michaellenaghan michaellenaghan May 28, 2016

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.

Copy link
Member

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.

@michaellenaghan
Copy link
Contributor Author

Anyone minding the store?

Copy link
Member

@mmerickel mmerickel left a 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.

@mmerickel mmerickel merged commit 704a078 into Pylons:main Jan 2, 2023
daeMOn63 pushed a commit to daeMOn63/colander-tools that referenced this pull request Feb 6, 2023
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.
daeMOn63 pushed a commit to daeMOn63/colander-tools that referenced this pull request Feb 6, 2023
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.
daeMOn63 pushed a commit to daeMOn63/colander-tools that referenced this pull request Feb 8, 2023
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.
daeMOn63 pushed a commit to daeMOn63/colander-tools that referenced this pull request Feb 8, 2023
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.
daeMOn63 pushed a commit to daeMOn63/colander-tools that referenced this pull request Mar 31, 2023
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.
daeMOn63 pushed a commit to daeMOn63/colander-tools that referenced this pull request Aug 4, 2023
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.
leplatrem added a commit to Kinto/kinto that referenced this pull request Dec 18, 2023
leplatrem added a commit to Kinto/kinto that referenced this pull request Dec 18, 2023
leplatrem added a commit to Kinto/kinto that referenced this pull request Dec 18, 2023
leplatrem added a commit to Kinto/kinto that referenced this pull request Dec 18, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants