zeroshade commented on code in PR #42118: URL: https://github.com/apache/arrow/pull/42118#discussion_r2051556087
########## cpp/src/arrow/c/dlpack.cc: ########## @@ -66,15 +67,15 @@ struct ManagerCtx { } // namespace Result<DLManagedTensor*> ExportArray(const std::shared_ptr<Array>& arr) { - // Define DLDevice struct nad check if array type is supported + // Define DLDevice struct and check if array type is supported // by the DLPack protocol at the same time. Raise TypeError if not. // Supported data types: int, uint, float with no validity buffer. - ARROW_ASSIGN_OR_RAISE(auto device, ExportDevice(arr)) + ARROW_ASSIGN_OR_RAISE(DLDevice device, ExportDevice(arr)) // Define the DLDataType struct const DataType& type = *arr->type(); std::shared_ptr<ArrayData> data = arr->data(); - ARROW_ASSIGN_OR_RAISE(auto dlpack_type, GetDLDataType(type)); + ARROW_ASSIGN_OR_RAISE(DLDataType dlpack_type, GetDLDataType(type)); Review Comment: in this case, it probably doesn't matter and I'd probably just leave it as auto unless someone specifically would prefer it to be more explicit. In most cases, unless it isn't particularly clear what the type is or there is some ambiguity, it's likely better "style" to just use auto (at least IMO) -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org