veluca93 commented on code in PR #6025:
URL: https://github.com/apache/arrow-rs/pull/6025#discussion_r1673746815
##########
parquet/src/arrow/buffer/dictionary_buffer.rs:
##########
@@ -162,6 +162,10 @@ impl<K: ArrowNativeType + Ord, V: OffsetSizeTrait>
DictionaryBuffer<K, V> {
let data = match cfg!(debug_assertions) {
true => builder.build().unwrap(),
+ // SAFETY: FIXME: this is unsound. data_type is passed by
the caller without
Review Comment:
Checking data_type SGTM.
Technically speaking, relying on callers doing "the right thing" is
_unsound_ (which is not the same as "exhibits undefined behaviour"): unsafe
code is sound if _no safe code could cause UB_, regardless of current usage.
Of course, if this is not exposed to the user, it is less important to fix,
but would still be nice 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]