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

SQLAlchemy Numeric deserialized as string with auto_field #241

Open
Anti-Distinctlyminty opened this issue Feb 9, 2022 · 0 comments
Open

Comments

@Anti-Distinctlyminty
Copy link

Anti-Distinctlyminty commented Feb 9, 2022

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?

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

No branches or pull requests

1 participant