| 123 | } |
| 124 | |
| 125 | Result<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 | |
| 133 | Result<std::shared_ptr<DataType>> NumPyDtypeToArrow(PyArray_Descr* descr) { |
| 134 | int type_num = fix_numpy_type_num(descr->type_num); |
no test coverage detected