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

Function NumPyDtypeToArrow

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

Source from the content-addressed store, hash-verified

123}
124
125Result<std::shared_ptr<DataType>> NumPyDtypeToArrow(PyObject* dtype) {
126 if (!PyObject_TypeCheck(dtype, &PyArrayDescr_Type)) {
127 return Status::TypeError("Did not pass numpy.dtype object");
128 }
129 PyArray_Descr* descr = reinterpret_cast<PyArray_Descr*>(dtype);
130 return NumPyDtypeToArrow(descr);
131}
132
133Result<std::shared_ptr<DataType>> NumPyDtypeToArrow(PyArray_Descr* descr) {
134 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