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

Method ParseUuid

python/pyarrow/src/arrow/python/common.h:423–434  ·  view source on GitHub ↗

Parse bytes from a uuid.UUID object (stores reference to keep bytes alive)

Source from the content-addressed store, hash-verified

421
422 // Parse bytes from a uuid.UUID object (stores reference to keep bytes alive)
423 Status ParseUuid(PyObject* obj) {
424 ref.reset(PyObject_GetAttrString(obj, "bytes"));
425 RETURN_IF_PYERROR();
426 if (!PyBytes_Check(ref.obj())) {
427 return Status::TypeError("Expected uuid.UUID.bytes to return bytes, got '",
428 Py_TYPE(ref.obj())->tp_name, "' object");
429 }
430 bytes = PyBytes_AS_STRING(ref.obj());
431 size = PyBytes_GET_SIZE(ref.obj());
432 is_utf8 = false;
433 return Status::OK();
434 }
435
436 protected:
437 OwnedRef ref;

Callers 1

ConvertMethod · 0.80

Calls 3

TypeErrorFunction · 0.50
OKFunction · 0.50
resetMethod · 0.45

Tested by

no test coverage detected