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

Function DeserializeExtInstance

python/pyarrow/src/arrow/python/extension_type.cc:55–70  ·  view source on GitHub ↗

Deserialize a Python ExtensionType instance

Source from the content-addressed store, hash-verified

53
54// Deserialize a Python ExtensionType instance
55PyObject* DeserializeExtInstance(PyObject* type_class,
56 std::shared_ptr<DataType> storage_type,
57 const std::string& serialized_data) {
58 OwnedRef storage_ref(wrap_data_type(storage_type));
59 if (!storage_ref) {
60 return nullptr;
61 }
62 OwnedRef data_ref(PyBytes_FromStringAndSize(
63 serialized_data.data(), static_cast<Py_ssize_t>(serialized_data.size())));
64 if (!data_ref) {
65 return nullptr;
66 }
67
68 return cpp_PyObject_CallMethod(type_class, "__arrow_ext_deserialize__", "OO",
69 storage_ref.obj(), data_ref.obj());
70}
71
72} // namespace
73

Callers 2

DeserializeMethod · 0.85
GetInstanceMethod · 0.85

Calls 3

cpp_PyObject_CallMethodFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected