Skip to content

SQLAlchemy Numeric deserialized as string with auto_field #241

@Anti-Distinctlyminty

Description

@Anti-Distinctlyminty

I have an SQLAlchemy mode with a Numeric column as in the following example

db = flask_sqlalchemy.SQLAlchemy()
ma = flask_marshmallow.Marshmallow()

class Project(db.Model):
    budget = db.Column(db.Numeric)

class ProjectSchema(ma.SQLAlchemyAutoSchema):
    class Meta:
        model = Project
    budget = ma.auto_field()

Deserialized values for the budget field appear as strings. However, if I remove the auto_field and use Number instead, all is well. Is there a reason why db.Numeric doesn't map to ma.Number?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions