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

Postgres Money Type #197

Open
Anti-Distinctlyminty opened this issue Aug 14, 2020 · 0 comments
Open

Postgres Money Type #197

Anti-Distinctlyminty opened this issue Aug 14, 2020 · 0 comments

Comments

@Anti-Distinctlyminty
Copy link

Anti-Distinctlyminty commented Aug 14, 2020

I have a sqlalchemy class with a postgres money field
budget = db.Column(sqlalchemy.dialects.postgresql.MONEY)

I'm using the SQLAlchemyAutoSchema to dump a record of containing this, but it is failing with the error
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]

I'm using marshmallow-sqlalchemy 0.23.1 and SQLAlchemy 1.3.15, and as far as I understand it, the MONEY type was added marshmallow-code/marshmallow-sqlalchemy#218

My completely uneducated guess is that the SQLA_TYPE_MAPPING is just trying to interpret the value as a decimal? However, the value in the query result object is a string, including the currency symbol. e.g. '$800.00'

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