| 126 | } |
| 127 | |
| 128 | Result<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 | |
| 136 | Result<std::shared_ptr<DataType>> NumPyDtypeToArrow(PyArray_Descr* descr) { |
| 137 | int type_num = fix_numpy_type_num(descr->type_num); |
no test coverage detected