From 22c5d361607ad82e9951e8ccb013f1c1c81cdfa1 Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Sat, 30 Sep 2017 19:46:36 -0500 Subject: [PATCH] Address a couple more infer warnings Change-Id: Ib30ff3d4784983342eca31405b8916dd4474be03 --- cpp/src/arrow/array.h | 2 +- cpp/src/arrow/ipc/reader.cc | 1 - cpp/src/arrow/python/numpy_to_arrow.cc | 5 +++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/src/arrow/array.h b/cpp/src/arrow/array.h index ee29d95068276..4ad60eb77f48e 100644 --- a/cpp/src/arrow/array.h +++ b/cpp/src/arrow/array.h @@ -84,7 +84,7 @@ struct Decimal; /// input array and replace them with newly-allocated data, changing the output /// data type as well. struct ARROW_EXPORT ArrayData { - ArrayData() {} + ArrayData() : length(0) {} ArrayData(const std::shared_ptr& type, int64_t length, int64_t null_count = kUnknownNullCount, int64_t offset = 0) diff --git a/cpp/src/arrow/ipc/reader.cc b/cpp/src/arrow/ipc/reader.cc index 09def6ea6ed4b..7ab8b92d9f40e 100644 --- a/cpp/src/arrow/ipc/reader.cc +++ b/cpp/src/arrow/ipc/reader.cc @@ -349,7 +349,6 @@ Status ReadDictionary(const Buffer& metadata, const DictionaryTypeMap& dictionar reinterpret_cast(dictionary_batch->data()); RETURN_NOT_OK( ReadRecordBatch(batch_meta, dummy_schema, kMaxNestingDepth, file, &batch)); - if (batch->num_columns() != 1) { return Status::Invalid("Dictionary record batch must only contain one field"); } diff --git a/cpp/src/arrow/python/numpy_to_arrow.cc b/cpp/src/arrow/python/numpy_to_arrow.cc index 37e85fc485bd1..2eb9de9dd1680 100644 --- a/cpp/src/arrow/python/numpy_to_arrow.cc +++ b/cpp/src/arrow/python/numpy_to_arrow.cc @@ -1220,8 +1220,9 @@ Status NdarrayToArrow(MemoryPool* pool, PyObject* ao, PyObject* mo, std::shared_ptr* out) { NumPyConverter converter(pool, ao, mo, type, use_pandas_null_sentinels); RETURN_NOT_OK(converter.Convert()); - DCHECK(converter.result()[0]); - *out = std::make_shared(converter.result()); + const auto& output_arrays = converter.result(); + DCHECK_GT(output_arrays.size(), 0); + *out = std::make_shared(output_arrays); return Status::OK(); }