EnricoMi commented on code in PR #48458:
URL: https://github.com/apache/arrow/pull/48458#discussion_r2610158277


##########
python/pyarrow/src/arrow/python/numpy_to_arrow.cc:
##########
@@ -365,14 +365,27 @@ Status CastBuffer(const std::shared_ptr<DataType>& 
in_type,
 }
 
 template <typename FromType, typename ToType>
-Status StaticCastBuffer(const Buffer& input, const int64_t length, MemoryPool* 
pool,
+Status StaticCastBuffer(const Buffer& input, int64_t length, MemoryPool* pool,
+                        const uint8_t* null_bitmap,
+                        const compute::CastOptions& cast_options,
                         std::shared_ptr<Buffer>* out) {
   ARROW_ASSIGN_OR_RAISE(auto result, AllocateBuffer(sizeof(ToType) * length, 
pool));
 
   auto in_values = reinterpret_cast<const FromType*>(input.data());
   auto out_values = reinterpret_cast<ToType*>(result->mutable_data());
+
+  constexpr FromType kMin = std::numeric_limits<ToType>::min();
+  constexpr FromType kMax = std::numeric_limits<ToType>::max();

Review Comment:
   What happens if `ToType` is wider than `FromType`?



-- 
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