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

Function TestUpdateWithNaN

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

Source from the content-addressed store, hash-verified

831}
832
833Status TestUpdateWithNaN() {
834 internal::DecimalMetadata metadata;
835 OwnedRef decimal_constructor_;
836 OwnedRef decimal_module;
837 RETURN_NOT_OK(internal::ImportModule("decimal", &decimal_module));
838 RETURN_NOT_OK(
839 internal::ImportFromModule(decimal_module.obj(), "Decimal", &decimal_constructor_));
840 std::string decimal_string("nan");
841 PyObject* nan_value =
842 internal::DecimalFromString(decimal_constructor_.obj(), decimal_string);
843
844 ASSERT_OK(metadata.Update(nan_value));
845 ASSERT_EQ(std::numeric_limits<int32_t>::min(), metadata.precision());
846 ASSERT_EQ(std::numeric_limits<int32_t>::min(), metadata.scale());
847
848 return Status::OK();
849}
850
851Status TestGetNumPyTypeName() {
852 ASSERT_EQ(GetNumPyTypeName(NPY_BOOL), "bool");

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