Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions c_glib/test/test-decimal128.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_divide_zero
decimal1 = Arrow::Decimal128.new(23423445)
decimal2 = Arrow::Decimal128.new(0)
message =
"[decimal128][divide]: Invalid: Division by 0 in Decimal128"
"[decimal128][divide]: Invalid: Division by 0 in Decimal"
assert_raise(Arrow::Error::Invalid.new(message)) do
decimal1.divide(decimal2)
end
Expand Down Expand Up @@ -236,7 +236,7 @@ def test_rescale_fail
decimal = Arrow::Decimal128.new(10)
message =
"[decimal128][rescale]: Invalid: " +
"Rescaling Decimal128 value would cause data loss"
"Rescaling Decimal value would cause data loss"
assert_raise(Arrow::Error::Invalid.new(message)) do
decimal.rescale(1, -1)
end
Expand Down
4 changes: 2 additions & 2 deletions c_glib/test/test-decimal256.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_divide_zero
decimal1 = Arrow::Decimal256.new(23423445)
decimal2 = Arrow::Decimal256.new(0)
message =
"[decimal256][divide]: Invalid: Division by 0 in Decimal256"
"[decimal256][divide]: Invalid: Division by 0 in Decimal"
assert_raise(Arrow::Error::Invalid.new(message)) do
decimal1.divide(decimal2)
end
Expand Down Expand Up @@ -223,7 +223,7 @@ def test_rescale_fail
decimal = Arrow::Decimal256.new(10)
message =
"[decimal256][rescale]: Invalid: " +
"Rescaling Decimal256 value would cause data loss"
"Rescaling Decimal value would cause data loss"
assert_raise(Arrow::Error::Invalid.new(message)) do
decimal.rescale(1, -1)
end
Expand Down
4 changes: 2 additions & 2 deletions c_glib/test/test-decimal32.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_divide_zero
decimal1 = Arrow::Decimal32.new(23423445)
decimal2 = Arrow::Decimal32.new(0)
message =
"[decimal32][divide]: Invalid: Division by 0 in Decimal32"
"[decimal32][divide]: Invalid: Division by 0 in Decimal"
assert_raise(Arrow::Error::Invalid.new(message)) do
decimal1.divide(decimal2)
end
Expand Down Expand Up @@ -214,7 +214,7 @@ def test_rescale_fail
decimal = Arrow::Decimal32.new(10)
message =
"[decimal32][rescale]: Invalid: " +
"Rescaling Decimal32 value would cause data loss"
"Rescaling Decimal value would cause data loss"
assert_raise(Arrow::Error::Invalid.new(message)) do
decimal.rescale(1, -1)
end
Expand Down
4 changes: 2 additions & 2 deletions c_glib/test/test-decimal64.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_divide_zero
decimal1 = Arrow::Decimal64.new(23423445)
decimal2 = Arrow::Decimal64.new(0)
message =
"[decimal64][divide]: Invalid: Division by 0 in Decimal64"
"[decimal64][divide]: Invalid: Division by 0 in Decimal"
assert_raise(Arrow::Error::Invalid.new(message)) do
decimal1.divide(decimal2)
end
Expand Down Expand Up @@ -214,7 +214,7 @@ def test_rescale_fail
decimal = Arrow::Decimal64.new(10)
message =
"[decimal64][rescale]: Invalid: " +
"Rescaling Decimal64 value would cause data loss"
"Rescaling Decimal value would cause data loss"
assert_raise(Arrow::Error::Invalid.new(message)) do
decimal.rescale(1, -1)
end
Expand Down
15 changes: 6 additions & 9 deletions cpp/src/arrow/array/concatenate_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,14 @@ TEST_F(ConcatenateTest, DictionaryTypeDifferentSizeIndex) {
auto bigger_dict_type = dictionary(uint16(), utf8());
auto dict_one = DictArrayFromJSON(dict_type, "[0]", "[\"A0\"]");
auto dict_two = DictArrayFromJSON(bigger_dict_type, "[0]", "[\"B0\"]");
ASSERT_RAISES(Invalid, Concatenate({dict_one, dict_two}).status());
ASSERT_RAISES(Invalid, Concatenate({dict_one, dict_two}));
}

TEST_F(ConcatenateTest, DictionaryTypeCantUnifyNullInDictionary) {
auto dict_type = dictionary(uint8(), utf8());
auto dict_one = DictArrayFromJSON(dict_type, "[0, 1]", "[null, \"A\"]");
auto dict_two = DictArrayFromJSON(dict_type, "[0, 1]", "[null, \"B\"]");
ASSERT_RAISES(Invalid, Concatenate({dict_one, dict_two}).status());
ASSERT_RAISES(Invalid, Concatenate({dict_one, dict_two}));
}

TEST_F(ConcatenateTest, DictionaryTypeEnlargedIndices) {
Expand All @@ -464,7 +464,7 @@ TEST_F(ConcatenateTest, DictionaryTypeEnlargedIndices) {

auto dict_one = std::make_shared<DictionaryArray>(dict_type, indices, dictionary_one);
auto dict_two = std::make_shared<DictionaryArray>(dict_type, indices, dictionary_two);
ASSERT_RAISES(Invalid, Concatenate({dict_one, dict_two}).status());
ASSERT_RAISES(Invalid, Concatenate({dict_one, dict_two}));

auto bigger_dict_type = dictionary(uint16(), uint16());

Expand Down Expand Up @@ -729,8 +729,7 @@ TEST_F(ConcatenateTest, OffsetOverflow) {
fake_long_list->data()->child_data[0] = fake_long->data();

ASSERT_RAISES(Invalid, internal::Concatenate({fake_long_list, fake_long_list}, pool,
&suggested_cast)
.status());
&suggested_cast));
ASSERT_TRUE(suggested_cast->Equals(*expected_suggestion));
}
}
Expand All @@ -740,8 +739,7 @@ TEST_F(ConcatenateTest, OffsetOverflow) {
fake_long_list->data()->GetMutableValues<int32_t>(1)[1] =
std::numeric_limits<int32_t>::max();
ASSERT_RAISES(Invalid, internal::Concatenate({fake_long_list, fake_long_list}, pool,
&suggested_cast)
.status());
&suggested_cast));
ASSERT_TRUE(suggested_cast->Equals(LargeVersionOfType(list_ty)));

auto list_view_ty = list_view(null());
Expand All @@ -757,8 +755,7 @@ TEST_F(ConcatenateTest, OffsetOverflow) {
mutable_sizes[0] = kInt32Max;
}
ASSERT_RAISES(Invalid, internal::Concatenate({fake_long_list_view, fake_long_list_view},
pool, &suggested_cast)
.status());
pool, &suggested_cast));
ASSERT_TRUE(suggested_cast->Equals(LargeVersionOfType(list_view_ty)));
}

Expand Down
8 changes: 4 additions & 4 deletions cpp/src/arrow/array/diff_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class DiffTest : public ::testing::Test {

void DoDiff() {
auto edits = Diff(*base_, *target_, default_memory_pool());
ASSERT_OK(edits.status());
ASSERT_OK(edits);
edits_ = edits.ValueOrDie();
ASSERT_OK(edits_->ValidateFull());
ASSERT_TRUE(edits_->type()->Equals(edits_type));
Expand All @@ -87,7 +87,7 @@ class DiffTest : public ::testing::Test {
void DoDiffAndFormat(std::stringstream* out) {
DoDiff();
auto formatter = MakeUnifiedDiffFormatter(*base_->type(), out);
ASSERT_OK(formatter.status());
ASSERT_OK(formatter);
ASSERT_OK(formatter.ValueOrDie()(*edits_, *base_, *target_));
}

Expand Down Expand Up @@ -800,10 +800,10 @@ TEST_F(DiffTest, CompareRandomStruct) {

auto type = struct_({field("i", int32()), field("s", utf8())});
auto base_res = StructArray::Make({int32_base, utf8_base}, type->fields());
ASSERT_OK(base_res.status());
ASSERT_OK(base_res);
base_ = base_res.ValueOrDie();
auto target_res = StructArray::Make({int32_target, utf8_target}, type->fields());
ASSERT_OK(target_res.status());
ASSERT_OK(target_res);
target_ = target_res.ValueOrDie();

std::stringstream formatted;
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/compute/kernels/scalar_arithmetic_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static void ArrayScalarKernel(benchmark::State& state) {
rand.Numeric<ArrowType>(array_size, min, max, args.null_proportion));

for (auto _ : state) {
ABORT_NOT_OK(Op(lhs, rhs, ArithmeticOptions(), nullptr).status());
ABORT_NOT_OK(Op(lhs, rhs, ArithmeticOptions(), nullptr));
}
state.SetItemsProcessed(state.iterations() * array_size);
}
Expand All @@ -103,7 +103,7 @@ static void ArrayArrayKernel(benchmark::State& state) {
rand.Numeric<ArrowType>(array_size, rmin, rmax, args.null_proportion));

for (auto _ : state) {
ABORT_NOT_OK(Op(lhs, rhs, ArithmeticOptions(), nullptr).status());
ABORT_NOT_OK(Op(lhs, rhs, ArithmeticOptions(), nullptr));
}
state.SetItemsProcessed(state.iterations() * array_size);
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/kernels/scalar_boolean_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static void ArrayArrayKernel(benchmark::State& state) {
auto rhs = rand.Boolean(array_size, /*true_probability=*/0.5, args.null_proportion);

for (auto _ : state) {
ABORT_NOT_OK(Op(lhs, rhs, nullptr).status());
ABORT_NOT_OK(Op(lhs, rhs, nullptr));
}
state.SetItemsProcessed(state.iterations() * array_size);
}
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/compute/kernels/scalar_cast_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static void BenchmarkNumericCast(benchmark::State& state,
random::RandomArrayGenerator rand(kSeed);
auto array = rand.Numeric<InputType>(args.size, min, max, args.null_proportion);
for (auto _ : state) {
ABORT_NOT_OK(Cast(array, to_type, options).status());
ABORT_NOT_OK(Cast(array, to_type, options));
}
}

Expand All @@ -54,7 +54,7 @@ static void BenchmarkFloatingToIntegerCast(benchmark::State& state,
std::shared_ptr<Array> values_as_float = *Cast(*array, from_type);

for (auto _ : state) {
ABORT_NOT_OK(Cast(values_as_float, to_type, options).status());
ABORT_NOT_OK(Cast(values_as_float, to_type, options));
}
}

Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/compute/kernels/scalar_compare_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static void BenchArrayScalar(benchmark::State& state, const std::string& op) {
auto array = rand.ArrayOf(ty, args.size, args.null_proportion);
auto scalar = *rand.ArrayOf(ty, 1, 0)->GetScalar(0);
for (auto _ : state) {
ABORT_NOT_OK(CallFunction(op, {array, Datum(scalar)}).status());
ABORT_NOT_OK(CallFunction(op, {array, Datum(scalar)}));
}
}

Expand All @@ -50,7 +50,7 @@ static void BenchArrayArray(benchmark::State& state, const std::string& op) {
auto lhs = rand.ArrayOf(ty, args.size, args.null_proportion);
auto rhs = rand.ArrayOf(ty, args.size, args.null_proportion);
for (auto _ : state) {
ABORT_NOT_OK(CallFunction(op, {lhs, rhs}).status());
ABORT_NOT_OK(CallFunction(op, {lhs, rhs}));
}
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/kernels/scalar_list_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static void BenchmarkListSlice(benchmark::State& state, const ListSliceOptions&
auto ctx = default_exec_context();
std::vector<Datum> input_args = {std::move(array)};
for (auto _ : state) {
ABORT_NOT_OK(CallFunction("list_slice", input_args, &opts, ctx).status());
ABORT_NOT_OK(CallFunction("list_slice", input_args, &opts, ctx));
}
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/kernels/scalar_random_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static void RandomKernel(benchmark::State& state, bool is_seed) {
const auto options =
is_seed ? RandomOptions::FromSeed(42) : RandomOptions::FromSystemRandom();
for (auto _ : state) {
ABORT_NOT_OK(CallFunction("random", ExecBatch({}, length), &options).status());
ABORT_NOT_OK(CallFunction("random", ExecBatch({}, length), &options));
}
state.SetItemsProcessed(state.iterations() * length);
}
Expand Down
12 changes: 6 additions & 6 deletions cpp/src/arrow/compute/kernels/scalar_temporal_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static void BenchmarkTemporalRounding(benchmark::State& state) {
EXPECT_OK_AND_ASSIGN(auto timestamp_array, array->View(timestamp_type));

for (auto _ : state) {
ABORT_NOT_OK(Op(timestamp_array, options, ctx).status());
ABORT_NOT_OK(Op(timestamp_array, options, ctx));
}

state.SetItemsProcessed(state.iterations() * array_size);
Expand All @@ -78,7 +78,7 @@ static void BenchmarkTemporal(benchmark::State& state) {
EXPECT_OK_AND_ASSIGN(auto timestamp_array, array->View(timestamp_type));

for (auto _ : state) {
ABORT_NOT_OK(Op(timestamp_array, ctx).status());
ABORT_NOT_OK(Op(timestamp_array, ctx));
}

state.SetItemsProcessed(state.iterations() * array_size);
Expand All @@ -96,7 +96,7 @@ static void BenchmarkTemporalBinary(benchmark::State& state) {
auto rhs = rand.ArrayOf(timestamp_type, args.size, args.null_proportion);

for (auto _ : state) {
ABORT_NOT_OK(Op(lhs, rhs, ctx).status());
ABORT_NOT_OK(Op(lhs, rhs, ctx));
}

state.SetItemsProcessed(state.iterations() * array_size);
Expand All @@ -116,7 +116,7 @@ static void BenchmarkStrftime(benchmark::State& state) {

auto options = StrftimeOptions();
for (auto _ : state) {
ABORT_NOT_OK(Strftime(timestamp_array, options, ctx).status());
ABORT_NOT_OK(Strftime(timestamp_array, options, ctx));
}

state.SetItemsProcessed(state.iterations() * array_size);
Expand All @@ -139,7 +139,7 @@ static void BenchmarkStrptime(benchmark::State& state) {
auto strptime_options = StrptimeOptions("%Y-%m-%dT%H:%M:%S", TimeUnit::MICRO, true);

for (auto _ : state) {
ABORT_NOT_OK(Strptime(string_array, strptime_options, ctx).status());
ABORT_NOT_OK(Strptime(string_array, strptime_options, ctx));
}

state.SetItemsProcessed(state.iterations() * array_size);
Expand All @@ -160,7 +160,7 @@ static void BenchmarkAssumeTimezone(benchmark::State& state) {
"Pacific/Marquesas", AssumeTimezoneOptions::Ambiguous::AMBIGUOUS_LATEST,
AssumeTimezoneOptions::Nonexistent::NONEXISTENT_EARLIEST);
for (auto _ : state) {
ABORT_NOT_OK(AssumeTimezone(timestamp_array, options, ctx).status());
ABORT_NOT_OK(AssumeTimezone(timestamp_array, options, ctx));
}

state.SetItemsProcessed(state.iterations() * array_size);
Expand Down
10 changes: 5 additions & 5 deletions cpp/src/arrow/compute/kernels/vector_hash_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static void BuildDictionary(benchmark::State& state) { // NOLINT non-const refe
ArrayFromVector<Int64Type, int64_t>(is_valid, values, &arr);

while (state.KeepRunning()) {
ABORT_NOT_OK(DictionaryEncode(arr).status());
ABORT_NOT_OK(DictionaryEncode(arr));
}
state.counters["null_percent"] =
static_cast<double>(arr->null_count()) / arr->length() * 100;
Expand All @@ -75,7 +75,7 @@ static void BuildStringDictionary(
ArrayFromVector<StringType, std::string>(data, &arr);

while (state.KeepRunning()) {
ABORT_NOT_OK(DictionaryEncode(arr).status());
ABORT_NOT_OK(DictionaryEncode(arr));
}
state.SetBytesProcessed(state.iterations() * total_bytes);
state.SetItemsProcessed(state.iterations() * data.size());
Expand Down Expand Up @@ -133,7 +133,7 @@ void BenchUnique(benchmark::State& state, const ParamType& params) {
params.GenerateTestData(&arr);

while (state.KeepRunning()) {
ABORT_NOT_OK(Unique(arr).status());
ABORT_NOT_OK(Unique(arr));
}
params.SetMetadata(state);
}
Expand All @@ -143,7 +143,7 @@ void BenchDictionaryEncode(benchmark::State& state, const ParamType& params) {
std::shared_ptr<Array> arr;
params.GenerateTestData(&arr);
while (state.KeepRunning()) {
ABORT_NOT_OK(DictionaryEncode(arr).status());
ABORT_NOT_OK(DictionaryEncode(arr));
}
params.SetMetadata(state);
}
Expand Down Expand Up @@ -215,7 +215,7 @@ void BenchValueCountsDictionaryChunks(benchmark::State& state, const ParamType&
auto chunked_array = std::make_shared<ChunkedArray>(chunks);

while (state.KeepRunning()) {
ABORT_NOT_OK(ValueCounts(chunked_array).status());
ABORT_NOT_OK(ValueCounts(chunked_array));
}
params.SetMetadata(state);
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/compute/kernels/vector_pairwise.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void RegisterPairwiseDiffKernels(std::string_view func_name,
doc, GetDefaultPairwiseOptions());

auto base_func_result = registry->GetFunction(std::string(base_func_name));
DCHECK_OK(base_func_result.status());
DCHECK_OK(base_func_result);
const auto& base_func = checked_cast<const ScalarFunction&>(**base_func_result);
DCHECK_EQ(base_func.arity().num_args, 2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ constexpr auto kSeed = 0x0ff1ce;
static void NthToIndicesBenchmark(benchmark::State& state,
const std::shared_ptr<Array>& values, int64_t n) {
for (auto _ : state) {
ABORT_NOT_OK(NthToIndices(*values, n).status());
ABORT_NOT_OK(NthToIndices(*values, n));
}
state.SetItemsProcessed(state.iterations() * values->length());
}
Expand Down
10 changes: 5 additions & 5 deletions cpp/src/arrow/compute/kernels/vector_selection_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ struct TakeBenchmark {
}

for (auto _ : state) {
ABORT_NOT_OK(Take(values, indices).status());
ABORT_NOT_OK(Take(values, indices));
}
state.SetItemsProcessed(state.iterations() * num_indices);
state.counters["selection_factor"] = selection_factor;
Expand Down Expand Up @@ -253,11 +253,11 @@ struct TakeBenchmark {

if (chunk_indices_too) {
for (auto _ : state) {
ABORT_NOT_OK(Take(values, chunked_indices).status());
ABORT_NOT_OK(Take(values, chunked_indices));
}
} else {
for (auto _ : state) {
ABORT_NOT_OK(Take(values, indices).status());
ABORT_NOT_OK(Take(values, indices));
}
}
state.SetItemsProcessed(state.iterations() * num_indices);
Expand Down Expand Up @@ -321,7 +321,7 @@ struct FilterBenchmark {
auto filter = rand.Boolean(values->length(), args.selected_proportion,
args.filter_null_proportion);
for (auto _ : state) {
ABORT_NOT_OK(Filter(values, filter).status());
ABORT_NOT_OK(Filter(values, filter));
}
state.SetItemsProcessed(state.iterations() * values->length());
}
Expand Down Expand Up @@ -356,7 +356,7 @@ struct FilterBenchmark {

auto batch = RecordBatch::Make(schema(fields), num_rows, columns);
for (auto _ : state) {
ABORT_NOT_OK(Filter(batch, filter).status());
ABORT_NOT_OK(Filter(batch, filter));
}
state.SetItemsProcessed(state.iterations() * num_rows);
}
Expand Down
Loading
Loading