Skip to content

parse_decimal allows invalid inputs e5 and - #10790

Description

@neilconway

Describe the bug

See repro.

To Reproduce

use arrow_array::types::Decimal128Type;
use arrow_cast::parse::parse_decimal;

parse_decimal::<Decimal128Type>("0E5", 10, 2);  // Ok(0)
parse_decimal::<Decimal128Type>("e5", 10, 2);   // Ok(0)
parse_decimal::<Decimal128Type>("-.", 10, 2);   // Ok(0)

Expected behavior

Invalid inputs should be rejected with an error.

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions