Skip to content

Commit 8e09ea3

Browse files
committed
Formatting
1 parent 2731700 commit 8e09ea3

File tree

7 files changed

+101
-100
lines changed

7 files changed

+101
-100
lines changed

cpp/src/arrow/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ if(ARROW_COMPUTE)
795795
compute/kernels/vector_rank.cc
796796
compute/kernels/vector_replace.cc
797797
compute/kernels/vector_run_end_encode.cc
798-
compute/kernels/vector_search_sorted.cc
798+
compute/kernels/vector_search_sorted.cc
799799
compute/kernels/vector_select_k.cc
800800
compute/kernels/vector_sort.cc
801801
compute/kernels/vector_statistics.cc

cpp/src/arrow/compute/api_vector.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static auto kArraySortOptionsType = GetFunctionOptionsType<ArraySortOptions>(
154154
DataMember("order", &ArraySortOptions::order),
155155
DataMember("null_placement", &ArraySortOptions::null_placement));
156156
static auto kSearchSortedOptionsType = GetFunctionOptionsType<SearchSortedOptions>(
157-
DataMember("side", &SearchSortedOptions::side));
157+
DataMember("side", &SearchSortedOptions::side));
158158
static auto kSortOptionsType = GetFunctionOptionsType<SortOptions>(
159159
DataMember("sort_keys", &SortOptions::sort_keys),
160160
DataMember("null_placement", &SortOptions::null_placement));

cpp/src/arrow/compute/api_vector.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,9 @@ Result<std::shared_ptr<Array>> SelectKUnstable(const Datum& datum,
547547
/// \return insertion indices as uint64 scalar or array
548548
ARROW_EXPORT
549549
Result<Datum> SearchSorted(
550-
const Datum& values, const Datum& needles,
551-
const SearchSortedOptions& options = SearchSortedOptions::Defaults(),
552-
ExecContext* ctx = NULLPTR);
550+
const Datum& values, const Datum& needles,
551+
const SearchSortedOptions& options = SearchSortedOptions::Defaults(),
552+
ExecContext* ctx = NULLPTR);
553553

554554
/// \brief Return the indices that would sort an array.
555555
///

cpp/src/arrow/compute/kernels/vector_search_sorted.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,4 +733,4 @@ void RegisterVectorSearchSorted(FunctionRegistry* registry) {
733733
}
734734

735735
} // namespace compute::internal
736-
} // namespace arrow
736+
} // namespace arrow

cpp/src/arrow/compute/kernels/vector_search_sorted_benchmark.cc

Lines changed: 44 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ std::shared_ptr<Int64Array> BuildSortedInt64Values(int64_t size_bytes) {
7474
const auto length = Int64LengthFromBytes(size_bytes);
7575
const auto max_value = std::max<int64_t>(length / 8, 1);
7676

77-
auto values = std::static_pointer_cast<Int64Array>(rand.Int64(length, 0, max_value, 0.0));
78-
std::vector<int64_t> data(values->raw_values(), values->raw_values() + values->length());
77+
auto values =
78+
std::static_pointer_cast<Int64Array>(rand.Int64(length, 0, max_value, 0.0));
79+
std::vector<int64_t> data(values->raw_values(),
80+
values->raw_values() + values->length());
7981
std::ranges::sort(data);
8082

8183
Int64Builder builder;
@@ -177,28 +179,33 @@ std::shared_ptr<Int64Array> BuildInt64NeedlesWithNullRuns(int64_t size_bytes,
177179
run_length);
178180
}
179181

180-
std::shared_ptr<Array> BuildRunEndEncodedInt64Values(int64_t size_bytes, int64_t run_length) {
182+
std::shared_ptr<Array> BuildRunEndEncodedInt64Values(int64_t size_bytes,
183+
int64_t run_length) {
181184
auto values = BuildRunHeavyInt64Values(Int64LengthFromBytes(size_bytes), run_length);
182-
return RunEndEncode(Datum(values), RunEndEncodeOptions{int32()}).ValueOrDie().make_array();
185+
return RunEndEncode(Datum(values), RunEndEncodeOptions{int32()})
186+
.ValueOrDie()
187+
.make_array();
183188
}
184189

185-
std::shared_ptr<Array> BuildRunEndEncodedInt64Needles(int64_t size_bytes, int64_t run_length) {
190+
std::shared_ptr<Array> BuildRunEndEncodedInt64Needles(int64_t size_bytes,
191+
int64_t run_length) {
186192
auto needles = BuildRunHeavyInt64Values(NeedleLengthFromBytes(size_bytes), run_length);
187193
return RunEndEncode(Datum(needles), RunEndEncodeOptions{int32()})
188194
.ValueOrDie()
189195
.make_array();
190196
}
191197

192198
std::shared_ptr<Array> BuildRunEndEncodedInt64NeedlesWithNullRuns(int64_t size_bytes,
193-
int64_t run_length) {
194-
auto needles =
195-
BuildRunHeavyInt64NeedlesWithNullRuns(NeedleLengthFromBytes(size_bytes), run_length);
199+
int64_t run_length) {
200+
auto needles = BuildRunHeavyInt64NeedlesWithNullRuns(NeedleLengthFromBytes(size_bytes),
201+
run_length);
196202
return RunEndEncode(Datum(needles), RunEndEncodeOptions{int32()})
197-
.ValueOrDie()
198-
.make_array();
203+
.ValueOrDie()
204+
.make_array();
199205
}
200206

201-
void SetBenchmarkCounters(benchmark::State& state, const Datum& values, const Datum& needles) {
207+
void SetBenchmarkCounters(benchmark::State& state, const Datum& values,
208+
const Datum& needles) {
202209
const auto values_length = values.length();
203210
const auto needles_length = needles.length();
204211
state.counters["values_length"] = static_cast<double>(values_length);
@@ -240,8 +247,8 @@ static void BM_SearchSortedRunEndEncodedValues(benchmark::State& state,
240247
RunSearchSortedBenchmark(state, values, needles, side);
241248
}
242249

243-
static void BM_SearchSortedRunEndEncodedValuesAndNeedles(
244-
benchmark::State& state, SearchSortedOptions::Side side) {
250+
static void BM_SearchSortedRunEndEncodedValuesAndNeedles(benchmark::State& state,
251+
SearchSortedOptions::Side side) {
245252
const Datum values(BuildRunEndEncodedInt64Values(state.range(0), kValuesRunLength));
246253
const Datum needles(BuildRunEndEncodedInt64Needles(state.range(0), kNeedlesRunLength));
247254
RunSearchSortedBenchmark(state, values, needles, side);
@@ -274,7 +281,8 @@ static void BM_SearchSortedStringScalarNeedle(benchmark::State& state,
274281
const auto values_array = BuildSortedStringValues(state.range(0));
275282
const auto scalar_index = values_array->length() / 2;
276283
const Datum values(values_array);
277-
const Datum needles(std::make_shared<StringScalar>(values_array->GetString(scalar_index)));
284+
const Datum needles(
285+
std::make_shared<StringScalar>(values_array->GetString(scalar_index)));
278286
RunSearchSortedBenchmark(state, values, needles, side);
279287
}
280288

@@ -283,8 +291,8 @@ static void BM_SearchSortedBinaryScalarNeedle(benchmark::State& state,
283291
const auto values_array = BuildSortedBinaryValues(state.range(0));
284292
const auto scalar_index = values_array->length() / 2;
285293
const Datum values(values_array);
286-
const Datum needles(std::make_shared<BinaryScalar>(
287-
std::string(values_array->GetView(scalar_index))));
294+
const Datum needles(
295+
std::make_shared<BinaryScalar>(std::string(values_array->GetView(scalar_index))));
288296
RunSearchSortedBenchmark(state, values, needles, side);
289297
}
290298

@@ -298,8 +306,8 @@ static void BM_SearchSortedRunEndEncodedValuesAndNeedlesQuick(
298306
BM_SearchSortedRunEndEncodedValuesAndNeedles(state, side);
299307
}
300308

301-
static void BM_SearchSortedInt64NeedlesWithNullRunsQuick(
302-
benchmark::State& state, SearchSortedOptions::Side side) {
309+
static void BM_SearchSortedInt64NeedlesWithNullRunsQuick(benchmark::State& state,
310+
SearchSortedOptions::Side side) {
303311
BM_SearchSortedInt64NeedlesWithNullRuns(state, side);
304312
}
305313

@@ -330,17 +338,17 @@ BENCHMARK_CAPTURE(BM_SearchSortedRunEndEncodedValuesAndNeedles, right,
330338
SearchSortedOptions::Right)
331339
->Apply(SetSearchSortedArgs);
332340
BENCHMARK_CAPTURE(BM_SearchSortedInt64NeedlesWithNullRuns, left,
333-
SearchSortedOptions::Left)
334-
->Apply(SetSearchSortedArgs);
341+
SearchSortedOptions::Left)
342+
->Apply(SetSearchSortedArgs);
335343
BENCHMARK_CAPTURE(BM_SearchSortedInt64NeedlesWithNullRuns, right,
336-
SearchSortedOptions::Right)
337-
->Apply(SetSearchSortedArgs);
344+
SearchSortedOptions::Right)
345+
->Apply(SetSearchSortedArgs);
338346
BENCHMARK_CAPTURE(BM_SearchSortedRunEndEncodedNeedlesWithNullRuns, left,
339-
SearchSortedOptions::Left)
340-
->Apply(SetSearchSortedArgs);
347+
SearchSortedOptions::Left)
348+
->Apply(SetSearchSortedArgs);
341349
BENCHMARK_CAPTURE(BM_SearchSortedRunEndEncodedNeedlesWithNullRuns, right,
342-
SearchSortedOptions::Right)
343-
->Apply(SetSearchSortedArgs);
350+
SearchSortedOptions::Right)
351+
->Apply(SetSearchSortedArgs);
344352
BENCHMARK_CAPTURE(BM_SearchSortedStringArrayNeedles, left, SearchSortedOptions::Left)
345353
->Apply(SetSearchSortedArgs);
346354
BENCHMARK_CAPTURE(BM_SearchSortedStringArrayNeedles, right, SearchSortedOptions::Right)
@@ -349,26 +357,26 @@ BENCHMARK_CAPTURE(BM_SearchSortedStringArrayNeedles, right, SearchSortedOptions:
349357
// String and binary scalar cases specifically exercise the direct scalar fast path that
350358
// avoids boxing a scalar needle into a temporary one-element array.
351359
BENCHMARK_CAPTURE(BM_SearchSortedStringScalarNeedle, left, SearchSortedOptions::Left)
352-
->Apply(SetSearchSortedQuickArgs);
360+
->Apply(SetSearchSortedQuickArgs);
353361
BENCHMARK_CAPTURE(BM_SearchSortedStringScalarNeedle, right, SearchSortedOptions::Right)
354-
->Apply(SetSearchSortedQuickArgs);
362+
->Apply(SetSearchSortedQuickArgs);
355363
BENCHMARK_CAPTURE(BM_SearchSortedBinaryScalarNeedle, left, SearchSortedOptions::Left)
356-
->Apply(SetSearchSortedQuickArgs);
364+
->Apply(SetSearchSortedQuickArgs);
357365
BENCHMARK_CAPTURE(BM_SearchSortedBinaryScalarNeedle, right, SearchSortedOptions::Right)
358-
->Apply(SetSearchSortedQuickArgs);
366+
->Apply(SetSearchSortedQuickArgs);
359367

360368
// Lightweight L1/L2 regressions keep a fast local loop for future optimization work.
361369
BENCHMARK_CAPTURE(BM_SearchSortedInt64ArrayNeedlesQuick, left, SearchSortedOptions::Left)
362-
->Apply(SetSearchSortedQuickArgs);
370+
->Apply(SetSearchSortedQuickArgs);
363371
BENCHMARK_CAPTURE(BM_SearchSortedInt64NeedlesWithNullRunsQuick, left,
364372
SearchSortedOptions::Left)
365-
->Apply(SetSearchSortedQuickArgs);
373+
->Apply(SetSearchSortedQuickArgs);
366374
BENCHMARK_CAPTURE(BM_SearchSortedRunEndEncodedValuesAndNeedlesQuick, left,
367-
SearchSortedOptions::Left)
368-
->Apply(SetSearchSortedQuickArgs);
375+
SearchSortedOptions::Left)
376+
->Apply(SetSearchSortedQuickArgs);
369377
BENCHMARK_CAPTURE(BM_SearchSortedRunEndEncodedNeedlesWithNullRunsQuick, left,
370378
SearchSortedOptions::Left)
371-
->Apply(SetSearchSortedQuickArgs);
379+
->Apply(SetSearchSortedQuickArgs);
372380

373381
} // namespace compute
374-
} // namespace arrow
382+
} // namespace arrow

cpp/src/arrow/compute/kernels/vector_search_sorted_test.cc

Lines changed: 48 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ void CheckSimpleSearchSorted(const std::shared_ptr<DataType>& type,
6262

6363
void CheckSimpleScalarSearchSorted(const std::shared_ptr<DataType>& type,
6464
const std::string& values_json,
65-
const std::string& needle_json,
66-
uint64_t expected_left,
65+
const std::string& needle_json, uint64_t expected_left,
6766
uint64_t expected_right) {
6867
auto values = ArrayFromJSON(type, values_json);
6968
auto needle = ScalarFromJSON(type, needle_json);
@@ -95,61 +94,55 @@ struct SearchSortedSmokeCase {
9594

9695
std::vector<SearchSortedSmokeCase> SupportedTypeSmokeCases() {
9796
return {
98-
{"Boolean", boolean(), "[false, false, true, true]", "[false, true]",
99-
"[0, 2]", "[2, 4]", "true", 2, 4},
100-
{"Int8", int8(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]",
101-
"[0, 3, 3, 4]", "3", 1, 3},
102-
{"Int16", int16(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]",
103-
"[0, 3, 3, 4]", "3", 1, 3},
104-
{"Int32", int32(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]",
105-
"[0, 3, 3, 4]", "3", 1, 3},
106-
{"Int64", int64(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]",
107-
"[0, 3, 3, 4]", "3", 1, 3},
108-
{"UInt8", uint8(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]",
109-
"[0, 3, 3, 4]", "3", 1, 3},
110-
{"UInt16", uint16(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]",
111-
"[0, 3, 3, 4]", "3", 1, 3},
112-
{"UInt32", uint32(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]",
113-
"[0, 3, 3, 4]", "3", 1, 3},
114-
{"UInt64", uint64(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]",
115-
"[0, 3, 3, 4]", "3", 1, 3},
97+
{"Boolean", boolean(), "[false, false, true, true]", "[false, true]", "[0, 2]",
98+
"[2, 4]", "true", 2, 4},
99+
{"Int8", int8(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
100+
"3", 1, 3},
101+
{"Int16", int16(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
102+
"3", 1, 3},
103+
{"Int32", int32(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
104+
"3", 1, 3},
105+
{"Int64", int64(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
106+
"3", 1, 3},
107+
{"UInt8", uint8(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
108+
"3", 1, 3},
109+
{"UInt16", uint16(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
110+
"3", 1, 3},
111+
{"UInt32", uint32(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
112+
"3", 1, 3},
113+
{"UInt64", uint64(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
114+
"3", 1, 3},
116115
{"Float32", float32(), "[1.0, 3.0, 3.0, 5.0]", "[0.0, 3.0, 4.0, 6.0]",
117116
"[0, 1, 3, 4]", "[0, 3, 3, 4]", "3.0", 1, 3},
118117
{"Float64", float64(), "[1.0, 3.0, 3.0, 5.0]", "[0.0, 3.0, 4.0, 6.0]",
119118
"[0, 1, 3, 4]", "[0, 3, 3, 4]", "3.0", 1, 3},
120-
{"Date32", date32(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]",
121-
"[0, 3, 3, 4]", "3", 1, 3},
119+
{"Date32", date32(), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
120+
"3", 1, 3},
122121
{"Date64", date64(), "[86400000, 259200000, 259200000, 432000000]",
123-
"[0, 259200000, 345600000, 518400000]", "[0, 1, 3, 4]",
124-
"[0, 3, 3, 4]", "259200000", 1, 3},
125-
{"Time32", time32(TimeUnit::SECOND), "[1, 3, 3, 5]", "[0, 3, 4, 6]",
126-
"[0, 1, 3, 4]", "[0, 3, 3, 4]", "3", 1, 3},
127-
{"Time64", time64(TimeUnit::NANO), "[1, 3, 3, 5]", "[0, 3, 4, 6]",
128-
"[0, 1, 3, 4]", "[0, 3, 3, 4]", "3", 1, 3},
122+
"[0, 259200000, 345600000, 518400000]", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
123+
"259200000", 1, 3},
124+
{"Time32", time32(TimeUnit::SECOND), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]",
125+
"[0, 3, 3, 4]", "3", 1, 3},
126+
{"Time64", time64(TimeUnit::NANO), "[1, 3, 3, 5]", "[0, 3, 4, 6]", "[0, 1, 3, 4]",
127+
"[0, 3, 3, 4]", "3", 1, 3},
129128
{"Timestamp", timestamp(TimeUnit::SECOND),
130129
R"(["1970-01-02", "1970-01-04", "1970-01-04", "1970-01-06"])",
131-
R"(["1970-01-01", "1970-01-04", "1970-01-05", "1970-01-07"])",
132-
"[0, 1, 3, 4]", "[0, 3, 3, 4]", R"("1970-01-04")", 1, 3},
130+
R"(["1970-01-01", "1970-01-04", "1970-01-05", "1970-01-07"])", "[0, 1, 3, 4]",
131+
"[0, 3, 3, 4]", R"("1970-01-04")", 1, 3},
133132
{"Duration", duration(TimeUnit::NANO), "[1, 3, 3, 5]", "[0, 3, 4, 6]",
134133
"[0, 1, 3, 4]", "[0, 3, 3, 4]", "3", 1, 3},
135-
{"Binary", binary(), R"(["aa", "bb", "bb", "dd"])",
136-
R"(["a", "bb", "bc", "z"])", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
137-
R"("bb")", 1, 3},
138-
{"String", utf8(), R"(["aa", "bb", "bb", "dd"])",
139-
R"(["a", "bb", "bc", "z"])", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
140-
R"("bb")", 1, 3},
134+
{"Binary", binary(), R"(["aa", "bb", "bb", "dd"])", R"(["a", "bb", "bc", "z"])",
135+
"[0, 1, 3, 4]", "[0, 3, 3, 4]", R"("bb")", 1, 3},
136+
{"String", utf8(), R"(["aa", "bb", "bb", "dd"])", R"(["a", "bb", "bc", "z"])",
137+
"[0, 1, 3, 4]", "[0, 3, 3, 4]", R"("bb")", 1, 3},
141138
{"LargeBinary", large_binary(), R"(["aa", "bb", "bb", "dd"])",
142-
R"(["a", "bb", "bc", "z"])", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
143-
R"("bb")", 1, 3},
139+
R"(["a", "bb", "bc", "z"])", "[0, 1, 3, 4]", "[0, 3, 3, 4]", R"("bb")", 1, 3},
144140
{"LargeString", large_utf8(), R"(["aa", "bb", "bb", "dd"])",
145-
R"(["a", "bb", "bc", "z"])", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
146-
R"("bb")", 1, 3},
141+
R"(["a", "bb", "bc", "z"])", "[0, 1, 3, 4]", "[0, 3, 3, 4]", R"("bb")", 1, 3},
147142
{"BinaryView", binary_view(), R"(["aa", "bb", "bb", "dd"])",
148-
R"(["a", "bb", "bc", "z"])", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
149-
R"("bb")", 1, 3},
143+
R"(["a", "bb", "bc", "z"])", "[0, 1, 3, 4]", "[0, 3, 3, 4]", R"("bb")", 1, 3},
150144
{"StringView", utf8_view(), R"(["aa", "bb", "bb", "dd"])",
151-
R"(["a", "bb", "bc", "z"])", "[0, 1, 3, 4]", "[0, 3, 3, 4]",
152-
R"("bb")", 1, 3},
145+
R"(["a", "bb", "bc", "z"])", "[0, 1, 3, 4]", "[0, 3, 3, 4]", R"("bb")", 1, 3},
153146
};
154147
}
155148

@@ -175,9 +168,8 @@ TEST(SearchSorted, ScalarNeedle) {
175168
auto values = ArrayFromJSON(int32(), "[1, 3, 5, 7]");
176169

177170
ASSERT_OK_AND_ASSIGN(
178-
auto result,
179-
SearchSorted(Datum(values), Datum(std::make_shared<Int32Scalar>(5)),
180-
SearchSortedOptions(SearchSortedOptions::Right)));
171+
auto result, SearchSorted(Datum(values), Datum(std::make_shared<Int32Scalar>(5)),
172+
SearchSortedOptions(SearchSortedOptions::Right)));
181173

182174
ASSERT_TRUE(result.is_scalar());
183175
ASSERT_EQ(checked_cast<const UInt64Scalar&>(*result.scalar()).value, 3);
@@ -281,7 +273,8 @@ TEST(SearchSorted, RejectUnclusteredNullValues) {
281273

282274
TEST(SearchSorted, RunEndEncodedNulls) {
283275
auto values_type = run_end_encoded(int16(), int32());
284-
ASSERT_OK_AND_ASSIGN(auto ree_values, REEFromJSON(values_type, "[null, null, 2, 4, 4]"));
276+
ASSERT_OK_AND_ASSIGN(auto ree_values,
277+
REEFromJSON(values_type, "[null, null, 2, 4, 4]"));
285278
auto needles_type = run_end_encoded(int16(), int32());
286279
ASSERT_OK_AND_ASSIGN(auto ree_needles,
287280
REEFromJSON(needles_type, "[null, null, 1, 4, 4, null, 8]"));
@@ -402,17 +395,15 @@ TEST_P(SearchSortedSupportedTypesTest, ArraySmoke) {
402395
TEST_P(SearchSortedSupportedTypesTest, ScalarSmoke) {
403396
const auto& param = GetParam();
404397
CheckSimpleScalarSearchSorted(param.type, param.values_json, param.scalar_needle_json,
405-
param.expected_scalar_left,
406-
param.expected_scalar_right);
398+
param.expected_scalar_left, param.expected_scalar_right);
407399
}
408400

409-
INSTANTIATE_TEST_SUITE_P(
410-
SupportedTypes, SearchSortedSupportedTypesTest,
411-
::testing::ValuesIn(SupportedTypeSmokeCases()),
412-
[](const ::testing::TestParamInfo<SearchSortedSmokeCase>& info) {
413-
return info.param.name;
414-
});
401+
INSTANTIATE_TEST_SUITE_P(SupportedTypes, SearchSortedSupportedTypesTest,
402+
::testing::ValuesIn(SupportedTypeSmokeCases()),
403+
[](const ::testing::TestParamInfo<SearchSortedSmokeCase>& info) {
404+
return info.param.name;
405+
});
415406

416407
} // namespace
417408
} // namespace compute
418-
} // namespace arrow
409+
} // namespace arrow

python/pyarrow/_compute_docstrings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757
5
5858
]
5959
>>> with_nulls = pa.array([None, 200, 300, 300], type=pa.int64())
60-
>>> pc.search_sorted(with_nulls, pa.array([50, 200, None, 400], type=pa.int64()))
60+
>>> pc.search_sorted(
61+
... with_nulls, pa.array([50, 200, None, 400], type=pa.int64())
62+
... )
6163
<pyarrow.lib.UInt64Array object at ...>
6264
[
6365
1,

0 commit comments

Comments
 (0)