pitrou commented on code in PR #50325:
URL: https://github.com/apache/arrow/pull/50325#discussion_r3672134964


##########
python/pyarrow/src/arrow/python/arrow_to_pandas.cc:
##########
@@ -1369,6 +1389,42 @@ struct ObjectWriterVisitor {
     return ConvertStruct(options, data, out_values);
   }
 
+  Status Visit(const ExtensionType& type) {
+    if (!IsUuidExtension(type)) {
+      return Status::NotImplemented("No implemented conversion to object 
dtype: ",
+                                    type.ToString());
+    }
+    ArrayVector storage_arrays;
+    storage_arrays.reserve(data.num_chunks());
+    for (int c = 0; c < data.num_chunks(); ++c) {
+      const auto& extension_array = checked_cast<const 
ExtensionArray&>(*data.chunk(c));
+      storage_arrays.push_back(extension_array.storage());
+    }
+    ChunkedArray storage(std::move(storage_arrays), type.storage_type());
+    OwnedRef uuid_module;
+    OwnedRef uuid_constructor;
+    RETURN_NOT_OK(internal::ImportModule("uuid", &uuid_module));
+    RETURN_NOT_OK(
+        internal::ImportFromModule(uuid_module.obj(), "UUID", 
&uuid_constructor));

Review Comment:
   There's some uuid support code in `helpers.cc` already, can we perhaps 
factor this out there?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to