You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "parker-cassar (via GitHub)" <gi...@apache.org> on 2026/08/01 06:02:30 UTC
Re: [PR] GH-50312: [Python] Fix UUID extension type round-trip to pandas returning bytes [arrow]
parker-cassar commented on code in PR #50325:
URL: https://github.com/apache/arrow/pull/50325#discussion_r3694761596
##########
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:
Good point, moved it in [352cafd](https://github.com/apache/arrow/pull/50325/commits/352cafde279351bc9520904159ce62e1acbab4f1)
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org