Skip to content

fix: error on malformed decimal type strings#75

Merged
zfarrell merged 1 commit intomainfrom
fix/decimal-parse-edge-cases
Feb 24, 2026
Merged

fix: error on malformed decimal type strings#75
zfarrell merged 1 commit intomainfrom
fix/decimal-parse-edge-cases

Conversation

@zfarrell
Copy link
Contributor

Summary

  • Change parse_decimal() to return Err when decimal types have more than 2 parameters (e.g., decimal(1,2,3)) instead of silently returning Ok(None) and falling through to the unknown type error
  • Add test coverage for negative scales (decimal(10, -2)) which are valid in Arrow

Follow-up to #71.

Test plan

  • test_decimal_too_many_parameters_rejected — verifies 3-param and 4-param decimals return clear error messages
  • test_decimal_negative_scale_valid — verifies decimal(10, -2) produces Decimal128(10, -2)
  • All existing tests pass (cargo test --lib types — 28 tests)

Change parse_decimal() to return an error when decimal types have more
than 2 parameters (e.g., decimal(1,2,3)) instead of silently treating
them as non-decimal types and falling through to "unknown type". Also
adds test coverage for negative scales which are valid in Arrow.
@zfarrell zfarrell merged commit ea3203b into main Feb 24, 2026
3 checks passed
@zfarrell zfarrell deleted the fix/decimal-parse-edge-cases branch February 24, 2026 19:44
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

Successfully merging this pull request may close these issues.

1 participant