Skip to content

decimal types fail because precision is negative

name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

Is your feature request related to a problem? Please describe.

A SQL Server tap generates a schema for a decimal column that looks like this:

          "Amount": {
            "inclusion": "available",
            "multipleOf": 0.01,
            "type": [
              "null",
              "number"
            ]
          }

This results in an error message: ValueError: valid range for prec is [1, MAX_PREC]

Upon inspection, the error is raised because the precision value calculated in https://gitlab.com/singer-core/target-core/-/blob/main/src/target/stream.py#L98 is -2. This is outside of the valid range [1, MAX_PREC]

Describe the solution you'd like

A clear and concise description of what you want to happen.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.