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

Method Validate

cpp/src/arrow/compute/function.cc:388–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386} // namespace
387
388Status Function::Validate() const {
389 if (!doc_.summary.empty()) {
390 // Documentation given, check its contents
391 int arg_count = static_cast<int>(doc_.arg_names.size());
392 // Some varargs functions allow 0 vararg, others expect at least 1,
393 // hence the two possible values below.
394 bool arg_count_match = (arg_count == arity_.num_args) ||
395 (arity_.is_varargs && arg_count == arity_.num_args + 1);
396 if (!arg_count_match) {
397 return Status::Invalid(
398 "In function '", name_,
399 "': ", "number of argument names for function documentation != function arity");
400 }
401 Status st = ValidateFunctionSummary(doc_.summary);
402 if (st.ok()) {
403 st &= ValidateFunctionDescription(doc_.description);
404 }
405 if (!st.ok()) {
406 return st.WithMessage("In function '", name_, "': ", st.message());
407 }
408 }
409 return Status::OK();
410}
411
412Status ScalarFunction::AddKernel(std::vector<InputType> in_types, OutputType out_type,
413 ArrayKernelExec exec, KernelInit init,

Callers 1

DoAddFunctionMethod · 0.45

Calls 7

ValidateFunctionSummaryFunction · 0.85
InvalidFunction · 0.50
OKFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected