Skip to content

Numeric with as_decimal=False are converted in the wrong colander type #108

@tonthon

Description

@tonthon

Given the following model

class MyModel(Base):
    id = Column(Integer, primary_key=True)
    quantity = Numeric(7,5, as_decimal=False)

The generated schema node for quantity is of type colander.Decimal

from colanderalchemy import SQLAlchemySchemaNode
schema = SQLAlchemySchemaNode(MyModel, includes=('quantity',))
schema['quantity'].typ
<colander.Decimal at 0x7f4b840f2a90>

It should be colander.Float.

In my case I found a turnaround by setting the typ afterwards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions