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

Function NumPyDtypeToArrow

python/pyarrow/src/arrow/python/numpy_convert.cc:128–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128Result<std::shared_ptr<DataType>> NumPyDtypeToArrow(PyObject* dtype) {
129 if (!PyObject_TypeCheck(dtype, &PyArrayDescr_Type)) {
130 return Status::TypeError("Did not pass numpy.dtype object");
131 }
132 PyArray_Descr* descr = reinterpret_cast<PyArray_Descr*>(dtype);
133 return NumPyDtypeToArrow(descr);
134}
135
136Result<std::shared_ptr<DataType>> NumPyDtypeToArrow(PyArray_Descr* descr) {
137 int type_num = fix_numpy_type_num(descr->type_num);

Callers 4

GetTypeMethod · 0.85

Calls 5

fix_numpy_type_numFunction · 0.85
TypeErrorFunction · 0.50
timestampFunction · 0.50
NotImplementedFunction · 0.50
durationFunction · 0.50

Tested by

no test coverage detected