Skip to content

Postgres Money Type #197

Description

@Anti-Distinctlyminty

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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