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

Function TestInferAllLeadingZeros

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

Source from the content-addressed store, hash-verified

427}
428
429Status TestInferAllLeadingZeros() {
430 OwnedRef decimal_constructor_;
431 OwnedRef decimal_module;
432
433 RETURN_NOT_OK(internal::ImportModule("decimal", &decimal_module));
434 RETURN_NOT_OK(
435 internal::ImportFromModule(decimal_module.obj(), "Decimal", &decimal_constructor_));
436
437 std::string decimal_string("0.001");
438 PyObject* python_decimal =
439 internal::DecimalFromString(decimal_constructor_.obj(), decimal_string);
440
441 internal::DecimalMetadata metadata;
442 ASSERT_OK(metadata.Update(python_decimal));
443 ASSERT_EQ(3, metadata.precision());
444 ASSERT_EQ(3, metadata.scale());
445
446 return Status::OK();
447}
448
449Status TestInferAllLeadingZerosExponentialNotationPositive() {
450 OwnedRef decimal_constructor_;

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