OmBiradar commented on code in PR #50322:
URL: https://github.com/apache/arrow/pull/50322#discussion_r3508211383
##########
cpp/src/arrow/util/key_value_metadata.cc:
##########
@@ -100,6 +100,11 @@ Result<std::string> KeyValueMetadata::Get(std::string_view
key) const {
}
Status KeyValueMetadata::Delete(int64_t index) {
+ if (ARROW_PREDICT_FALSE(index < 0 || std::cmp_greater_equal(index,
values_.size()))) {
+ return Status::IndexError("Index out of bounds. Expected 0 to ",
+ std::to_string(keys_.size() - 1), ", but got ",
+ std::to_string(index));
+ }
Review Comment:
This I will add
--
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]