Skip to content

Upgrade to marshmallow 3 #517

@sloria

Description

@sloria

👋 Just dropping by to let you know that marshmallow v3 is released.

Upgrading will provide a few benefits for this project:

dump_to="jobId", load_from="jobId",

You could even do automatic camel-casing using this snippet: https://marshmallow.readthedocs.io/en/latest/examples.html#inflection-camel-casing-keys

After skimming the codebase, it looks like the migration will be straightforward.

  • Replace usages of load_from and dump_to with data_key.
  • Update call sites of JobSchema.load[s] to expect the deserialized data as the return value instead of a tuple. Instead of getting the errors from a tuple, handle ValidationErrors.
from marshmallow import ValidationError


try:
    job_object = JobSchema.load(job)
except ValidationError as error:
    errors = error.messages

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions