MCPcopy Create free account
hub / github.com/apache/arrow / TestSimpleInference

Function TestSimpleInference

python/pyarrow/src/arrow/python/python_test.cc:813–831  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

811}
812
813Status TestSimpleInference() {
814 OwnedRef decimal_constructor_;
815 OwnedRef decimal_module;
816
817 RETURN_NOT_OK(internal::ImportModule("decimal", &decimal_module));
818 RETURN_NOT_OK(
819 internal::ImportFromModule(decimal_module.obj(), "Decimal", &decimal_constructor_));
820
821 std::string decimal_string("0.01");
822 PyObject* value =
823 internal::DecimalFromString(decimal_constructor_.obj(), decimal_string);
824 ASSERT_NE(value, nullptr);
825 internal::DecimalMetadata metadata;
826 ASSERT_OK(metadata.Update(value));
827 ASSERT_EQ(2, metadata.precision());
828 ASSERT_EQ(2, metadata.scale());
829
830 return Status::OK();
831}
832
833Status TestUpdateWithNaN() {
834 internal::DecimalMetadata metadata;

Callers

nothing calls this directly

Calls 7

ImportModuleFunction · 0.85
ImportFromModuleFunction · 0.85
DecimalFromStringFunction · 0.70
OKFunction · 0.50
UpdateMethod · 0.45
precisionMethod · 0.45
scaleMethod · 0.45

Tested by

no test coverage detected