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 bug with Any validator and REMOVE_EXTRA #524

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

zxdavb
Copy link

@zxdavb zxdavb commented Aug 17, 2024

I refer to the bug fixed by PR #522.

I am getting a similar issue, and I note that this test would fail with 0.15.2 (but not 0.13.1):

def test_key4():
    schema = Schema(
        {
            Any("name", "area"): str,
            "domain": str,
        },
        extra=REMOVE_EXTRA,  # instead of ALLOW_EXTRA
    )
    schema(
        {
            "name": "one",
            "domain": "two",
            "additional_key": "extra",
        }
    )

This PR offers a fix for the above, and extends the tests to all 4 possible variants of extra=.

Regarding the impact of this PR upon the goals of PR #479 - I note that test_key1 and test_key2 continue to pass.

@zxdavb zxdavb changed the title WIP: Fix bug with REMOVE_EXTRA and Any validator Fix bug with REMOVE_EXTRA and Any validator Aug 17, 2024
@zxdavb zxdavb changed the title Fix bug with REMOVE_EXTRA and Any validator Fix bug with Any validator and REMOVE_EXTRA Aug 21, 2024
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.

1 participant