You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2023/01/11 19:58:33 UTC

[GitHub] [arrow] felipecrv commented on a diff in pull request #24372: GH-14863: [C++] Add appender functions to array builders that can take optionals

felipecrv commented on code in PR #24372:
URL: https://github.com/apache/arrow/pull/24372#discussion_r1067404158


##########
cpp/src/arrow/testing/matchers.h:
##########
@@ -430,14 +430,10 @@ DataEqMatcher DataEqArray(T type, const std::vector<std::optional<ValueType>>& v
   static const bool need_safe_append = !is_fixed_width(T::type_id);
 
   for (auto value : values) {
-    if (value) {
-      if (need_safe_append) {
-        builder.UnsafeAppend(*value);
-      } else {
-        DCHECK_OK(builder.Append(*value));
-      }
+    if (need_safe_append) {
+      builder.UnsafeAppendOrNull(value);

Review Comment:
   I noticed that too. And decided to preserve the confusion. It would be great to fix it though by removing the `!` and then flipping the cases.



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