Skip to content

Clarify JSON marshalling of Decimal values #751

@amotl

Description

@amotl

About

How to marshal values of Python's Decimal type.

Status quo

Currently, the library is conveying Decimal values as strings.

if isinstance(obj, Decimal):
return str(obj)

See also

Others apparently need serialization to float.

        if isinstance(obj, Decimal):
            return float(obj)

-- https://github.com/crate-workbench/meltano-target-cratedb/blob/148a2d5ec7131658c1a74aed7d91f23befc81341/target_cratedb/sqlalchemy/patch.py#L65-L66

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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