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

Method VisitNdarray

python/pyarrow/src/arrow/python/inference.cc:679–696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

677 }
678
679 Status VisitNdarray(PyObject* obj, bool* keep_going) {
680 PyArray_Descr* dtype = PyArray_DESCR(reinterpret_cast<PyArrayObject*>(obj));
681 if (dtype->type_num == NPY_OBJECT) {
682 return VisitList(obj, keep_going);
683 }
684 // Not an object array: infer child Arrow type from dtype
685 if (!list_inferrer_) {
686 list_inferrer_.reset(
687 new TypeInferrer(pandas_null_sentinels_, validate_interval_, make_unions_));
688 }
689 ++list_count_;
690
691 // XXX(wesm): In ARROW-4324 I added accounting to check whether
692 // all of the non-null values have NumPy dtypes, but the
693 // total_count not being properly incremented here
694 ++(*list_inferrer_).total_count_;
695 return list_inferrer_->VisitDType(dtype, keep_going);
696 }
697
698 Status VisitDict(PyObject* obj) {
699 PyObject* key_obj;

Callers

nothing calls this directly

Calls 2

VisitDTypeMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected