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

Function TestPythonDecimalToString

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

Source from the content-addressed store, hash-verified

359#endif
360
361Status TestPythonDecimalToString() {
362 OwnedRef decimal_constructor_;
363 OwnedRef decimal_module;
364
365 RETURN_NOT_OK(internal::ImportModule("decimal", &decimal_module));
366 RETURN_NOT_OK(
367 internal::ImportFromModule(decimal_module.obj(), "Decimal", &decimal_constructor_));
368
369 std::string decimal_string("-39402950693754869342983");
370 PyObject* python_object =
371 internal::DecimalFromString(decimal_constructor_.obj(), decimal_string);
372 ASSERT_NE(python_object, nullptr);
373
374 std::string string_result;
375 ASSERT_OK(internal::PythonDecimalToString(python_object, &string_result));
376
377 return Status::OK();
378}
379
380Status TestInferPrecisionAndScale() {
381 OwnedRef decimal_constructor_;

Callers

nothing calls this directly

Calls 5

ImportModuleFunction · 0.85
ImportFromModuleFunction · 0.85
PythonDecimalToStringFunction · 0.85
DecimalFromStringFunction · 0.70
OKFunction · 0.50

Tested by

no test coverage detected