| 671 | } |
| 672 | |
| 673 | Status TestDecimal256OverflowFails() { |
| 674 | Decimal256 value; |
| 675 | OwnedRef decimal_constructor_; |
| 676 | OwnedRef decimal_module; |
| 677 | |
| 678 | RETURN_NOT_OK(internal::ImportModule("decimal", &decimal_module)); |
| 679 | RETURN_NOT_OK( |
| 680 | internal::ImportFromModule(decimal_module.obj(), "Decimal", &decimal_constructor_)); |
| 681 | |
| 682 | std::string decimal_string( |
| 683 | "999999999999999999999999999999999999999999999999999999999999999999999999999.9"); |
| 684 | PyObject* python_decimal = |
| 685 | internal::DecimalFromString(decimal_constructor_.obj(), decimal_string); |
| 686 | |
| 687 | internal::DecimalMetadata metadata; |
| 688 | ASSERT_OK(metadata.Update(python_decimal)); |
| 689 | ASSERT_EQ(76, metadata.precision()); |
| 690 | ASSERT_EQ(1, metadata.scale()); |
| 691 | |
| 692 | auto type = ::arrow::smallest_decimal(76, 76); |
| 693 | const auto& decimal_type = checked_cast<const DecimalType&>(*type); |
| 694 | ASSERT_RAISES(Invalid, |
| 695 | internal::DecimalFromPythonDecimal(python_decimal, decimal_type, &value)); |
| 696 | return Status::OK(); |
| 697 | } |
| 698 | |
| 699 | Status TestNoneAndNaN() { |
| 700 | OwnedRef list_ref(PyList_New(4)); |
nothing calls this directly
no test coverage detected