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.

UnsupportedValueError on marshmallow.fields.Number

See original GitHub issue

Recently I noticed that marshmallow-jsonschema does not work with marshmallow.fields.Number field and raises UnsupportedValueError.

Is there a particular reason why it does not? It works well with marshmallow.fields.Integer. Maybe we should just map it to Integer?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
fuhrystevecommented, Aug 14, 2019

Who wrote that garbage?? 🤣

I think it’s because mapping is basically an inverse of TYPE_MAPPING and some of the values needed to be added computationally at run-time based on what’s in the actual schema at hand.

1reaction
fuhrystevecommented, Aug 14, 2019

I don’t remember why either. I think it may have been because someone wanted to be able to extend & override it more easily, you’d have to dig through the commit history a bit I guess to figure out why that mapping is so weirdly layed out and split apart.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python marshmallow.fields.Number() Examples
This page shows Python examples of marshmallow.fields.Number. ... Number): raise UnsupportedValueError( "'Range' validator for non-number fields is not ...
Read more >
Fields — marshmallow 3.19.0 documentation
Base class for number fields. Pluck (nested, field_name, **kwargs). Allows you to replace nested data with one of the data's fields.
Read more >
How to use the marshmallow.fields.Number function in ... - Snyk
Number function in marshmallow. To help you get started, we've selected a few marshmallow examples, based on popular ways it is used in...
Read more >
Marshmallow for python giving ValueError: not enough values ...
Here are my Schema, Model, and Resource file for the same. schemas/post.py from marshmallow import Schema, fields, validate, post_dump from ...
Read more >
marshmallow - Read the Docs
from marshmallow import Schema, fields, pprint class ArtistSchema(Schema): ... It has no external dependencies other than the Python standard library.
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