question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ChangedInMarshmallow3Warning with Python 3.7

See original GitHub issue

Using Python 3.7 and having installed it the standard way™:

$ pip install marshmallow

I get an unexpected warning:

/usr/local/lib/python3.7/dist-packages/marshmallow/schema.py:364: ChangedInMarshmallow3Warning: strict=False is not recommended. In marshmallow 3.0, schemas will always be strict. See https://marshmallow.readthedocs.io/en/latest/upgrading.html#schemas-are-always-strict ChangedInMarshmallow3Warning

And despite what the documentation says, <form>.load(…) returns a tuple but shouldn’t.

minimal example (not authoritative)
import typing import Tuple
from marshmallow import fields, Schema, ValidationError

class RegistrationSchema(Schema):
    email = fields.Email(required=True)

try:
    result = RegistrationSchema().load({'email', 'nospam'})
    if isinstance(result, Tuple):
        print('unexpected')
except ValidationError as err:
    print('ok')

# → gives: "unexpected"

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sloriacommented, Feb 13, 2019

@rtaft You’re right. I was able to reproduce it. I’ve opened a new bug issue: #1134.

1reaction
lafrechcommented, Jan 25, 2019
pip install marshmallow

installs marshmallow 2, as marshmallow 3 is still beta.

This warning was added to marshmallow 2 to prepare marshmallow 3 migration. You may ignore it, or make all your schemas strict to be ready for the migration. (Hint: you may declare a strict base schema and have all your schemas inherit from it.)

The tuple is expected return value for marshmallow 2. I suppose you read marshmallow 3 documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changelog — marshmallow 3.19.0 documentation
Prevent warning about importing from collections on Python 3.7 (#1354). ... A ChangedInMarshmallow3Warning is no longer raised when strict=False (#1108).
Read more >
Python Release Python 3.7.15
Python 3.7.15. Release Date: Oct. 11, 2022. Note: The release you are looking at is Python 3.7.15, a security bugfix release for the...
Read more >
Python Release Python 3.7.0b3
Python 3.7.0b3. Release Date: March 29, 2018. This is a beta preview of Python 3.7. Python 3.7 is still in development.
Read more >
What's New In Python 3.7 — Python 3.11.1 documentation
Python 3.7 was released on June 27, 2018. For full details, see the changelog. Summary – Release Highlights¶. New syntax features: PEP 563 ......
Read more >
Python Release Python 3.7.5
Note: The release you are looking at is Python 3.7.5, a bugfix release for the legacy 3.7 series which is now in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found