neilconway opened a new pull request, #10010:
URL: https://github.com/apache/arrow-rs/pull/10010

   # Which issue does this PR close?
   
   - Closes #10009.
   
   # Rationale for this change
   
   When casting string values to decimal, `parse_string_to_decimal_native` 
treated empty strings and whitespace-only strings as valid input, resulting in 
a decimal with a value of 0. This is inconsistent with both `parse_decimal`, as 
well as how parsing and string -> numeric casts work for floating point types: 
in both cases, empty strings and whitespace-only strings are rejected with an 
error.
   
   # What changes are included in this PR?
   
   * Change `parse_string_to_decimal_native` to reject empty strings and 
whitespace-only strings with an error
   * Add test coverage
   
   # Are these changes tested?
   
   Yes, new tests added.
   
   # Are there any user-facing changes?
   
   Yes, this changes the behavior of string -> decimal casts. The previous 
behavior is (IMO) clearly incorrect but it is possible that some user code 
relies upon it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to