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

Method Append

python/pyarrow/src/arrow/python/python_to_arrow.cc:992–1014  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

990class PyStructConverter : public StructConverter<PyConverter, PyConverterTrait> {
991 public:
992 Status Append(PyObject* value) override {
993 if (PyValue::IsNull(this->options_, value)) {
994 return this->struct_builder_->AppendNull();
995 } else if (arrow::py::is_scalar(value)) {
996 ARROW_ASSIGN_OR_RAISE(std::shared_ptr<Scalar> scalar,
997 arrow::py::unwrap_scalar(value));
998 return this->struct_builder_->AppendScalar(GetStorageScalar(*scalar));
999 }
1000 switch (input_kind_) {
1001 case InputKind::DICT:
1002 RETURN_NOT_OK(AppendDict(value));
1003 return this->struct_builder_->Append();
1004 case InputKind::TUPLE:
1005 RETURN_NOT_OK(AppendTuple(value));
1006 return this->struct_builder_->Append();
1007 case InputKind::ITEMS:
1008 RETURN_NOT_OK(AppendItems(value));
1009 return this->struct_builder_->Append();
1010 default:
1011 RETURN_NOT_OK(InferInputKind(value));
1012 return Append(value);
1013 }
1014 }
1015
1016 protected:
1017 Status Init(MemoryPool* pool) override {

Callers

nothing calls this directly

Calls 7

is_scalarFunction · 0.85
IsNullFunction · 0.50
ARROW_ASSIGN_OR_RAISEFunction · 0.50
AppendFunction · 0.50
AppendNullMethod · 0.45
AppendScalarMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected