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

Function UuidFromBytes

python/pyarrow/src/arrow/python/helpers.cc:365–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363}
364
365Result<PyObject*> UuidFromBytes(std::string_view bytes, PyObject* kwargs) {
366 PyObject* uuid_class = GetUuidClass();
367 if (!uuid_class) {
368 return Status::Invalid("Could not import uuid.UUID");
369 }
370 OwnedRef py_bytes(
371 PyBytes_FromStringAndSize(bytes.data(), static_cast<Py_ssize_t>(bytes.size())));
372 RETURN_IF_PYERROR();
373 if (PyDict_SetItemString(kwargs, "bytes", py_bytes.obj()) < 0) {
374 RETURN_IF_PYERROR();
375 }
376 PyObject* empty_args = Py_GetConstantBorrowed(Py_CONSTANT_EMPTY_TUPLE);
377 PyObject* result = PyObject_Call(uuid_class, empty_args, kwargs);
378 RETURN_IF_PYERROR();
379 return result;
380}
381
382namespace {
383

Callers 1

VisitMethod · 0.85

Calls 4

GetUuidClassFunction · 0.85
InvalidFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected