Skip to content

Commit c4dfad8

Browse files
no authortexodus
no author
authored andcommitted
Apply autofix
1 parent 53db443 commit c4dfad8

File tree

177 files changed

+7437
-6198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+7437
-6198
lines changed

cpp/perspective/src/cpp/aggregate.cpp

+142-104
Large diffs are not rendered by default.

cpp/perspective/src/cpp/aggspec.cpp

+21-14
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ t_col_name_type::t_col_name_type(const std::string& name, t_dtype type)
2323

2424
t_aggspec::t_aggspec() {}
2525

26-
t_aggspec::t_aggspec(
27-
const std::string& name, t_aggtype agg, const std::vector<t_dep>& dependencies)
26+
t_aggspec::t_aggspec(const std::string& name, t_aggtype agg,
27+
const std::vector<t_dep>& dependencies)
2828
: m_name(name)
2929
, m_disp_name(name)
3030
, m_agg(agg)
3131
, m_dependencies(dependencies) {}
3232

33-
t_aggspec::t_aggspec(const std::string& aggname, t_aggtype agg, const std::string& dep)
33+
t_aggspec::t_aggspec(
34+
const std::string& aggname, t_aggtype agg, const std::string& dep)
3435
: m_name(aggname)
3536
, m_disp_name(aggname)
3637
, m_agg(agg)
@@ -40,23 +41,24 @@ t_aggspec::t_aggspec(t_aggtype agg, const std::string& dep)
4041
: m_agg(agg)
4142
, m_dependencies(std::vector<t_dep>{t_dep(dep, DEPTYPE_COLUMN)}) {}
4243

43-
t_aggspec::t_aggspec(const std::string& name, const std::string& disp_name, t_aggtype agg,
44-
const std::vector<t_dep>& dependencies)
44+
t_aggspec::t_aggspec(const std::string& name, const std::string& disp_name,
45+
t_aggtype agg, const std::vector<t_dep>& dependencies)
4546
: m_name(name)
4647
, m_disp_name(disp_name)
4748
, m_agg(agg)
4849
, m_dependencies(dependencies) {}
4950

50-
t_aggspec::t_aggspec(const std::string& name, const std::string& disp_name, t_aggtype agg,
51-
const std::vector<t_dep>& dependencies, t_sorttype sort_type)
51+
t_aggspec::t_aggspec(const std::string& name, const std::string& disp_name,
52+
t_aggtype agg, const std::vector<t_dep>& dependencies, t_sorttype sort_type)
5253
: m_name(name)
5354
, m_disp_name(disp_name)
5455
, m_agg(agg)
5556
, m_dependencies(dependencies)
5657
, m_sort_type(sort_type) {}
5758

58-
t_aggspec::t_aggspec(const std::string& aggname, const std::string& disp_aggname, t_aggtype agg,
59-
t_uindex agg_one_idx, t_uindex agg_two_idx, double agg_one_weight, double agg_two_weight)
59+
t_aggspec::t_aggspec(const std::string& aggname,
60+
const std::string& disp_aggname, t_aggtype agg, t_uindex agg_one_idx,
61+
t_uindex agg_two_idx, double agg_one_weight, double agg_two_weight)
6062
: m_name(aggname)
6163
, m_disp_name(disp_aggname)
6264
, m_agg(agg)
@@ -232,7 +234,9 @@ get_simple_accumulator_type(t_dtype coltype) {
232234
return DTYPE_FLOAT64;
233235
}
234236

235-
default: { PSP_COMPLAIN_AND_ABORT("Unexpected coltype"); }
237+
default: {
238+
PSP_COMPLAIN_AND_ABORT("Unexpected coltype");
239+
}
236240
}
237241
return DTYPE_NONE;
238242
}
@@ -271,7 +275,7 @@ std::vector<std::string>
271275
t_aggspec::get_input_depnames() const {
272276
std::vector<std::string> rval;
273277
rval.reserve(m_dependencies.size());
274-
for (const auto & d : m_dependencies) {
278+
for (const auto& d : m_dependencies) {
275279
rval.push_back(d.name());
276280
}
277281
return rval;
@@ -281,7 +285,7 @@ std::vector<std::string>
281285
t_aggspec::get_output_depnames() const {
282286
std::vector<std::string> rval;
283287
rval.reserve(m_dependencies.size());
284-
for (const auto & d: m_dependencies) {
288+
for (const auto& d : m_dependencies) {
285289
rval.push_back(d.name());
286290
}
287291
return rval;
@@ -298,7 +302,8 @@ t_aggspec::get_output_specs(const t_schema& schema) const {
298302
case AGGTYPE_MUL:
299303
case AGGTYPE_SUM_NOT_NULL: {
300304
t_dtype coltype = schema.get_dtype(m_dependencies[0].name());
301-
return mk_col_name_type_vec(name(), get_simple_accumulator_type(coltype));
305+
return mk_col_name_type_vec(
306+
name(), get_simple_accumulator_type(coltype));
302307
}
303308
case AGGTYPE_ANY:
304309
case AGGTYPE_UNIQUE:
@@ -352,7 +357,9 @@ t_aggspec::get_output_specs(const t_schema& schema) const {
352357
case AGGTYPE_DISTINCT_COUNT: {
353358
return mk_col_name_type_vec(name(), DTYPE_UINT32);
354359
}
355-
default: { PSP_COMPLAIN_AND_ABORT("Unknown agg type"); }
360+
default: {
361+
PSP_COMPLAIN_AND_ABORT("Unknown agg type");
362+
}
356363
}
357364

358365
return std::vector<t_col_name_type>();

cpp/perspective/src/cpp/arg_sort.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ t_argsort_comparator::operator()(t_index a, t_index b) const {
6060
}
6161

6262
void
63-
simple_argsort(
64-
std::vector<t_tscalar>& v, std::vector<t_index>& output, const t_sorttype& sort_type) {
63+
simple_argsort(std::vector<t_tscalar>& v, std::vector<t_index>& output,
64+
const t_sorttype& sort_type) {
6565
// Output should be the same size is v
6666
for (t_index i = 0, loop_end = output.size(); i != loop_end; ++i)
6767
output[i] = i;

cpp/perspective/src/cpp/arrow_csv.cpp

+32-20
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
#include <arrow/io/memory.h>
1414

1515
#ifdef PSP_ENABLE_WASM
16-
// This causes build warnings
17-
// https://github.com/emscripten-core/emscripten/issues/8574
18-
#include <perspective/vendor/arrow_single_threaded_reader.h>
16+
// This causes build warnings
17+
// https://github.com/emscripten-core/emscripten/issues/8574
18+
#include <perspective/vendor/arrow_single_threaded_reader.h>
1919
#else
20-
#include <arrow/csv/reader.h>
20+
#include <arrow/csv/reader.h>
2121
#endif
2222

2323
namespace perspective {
@@ -30,7 +30,8 @@ namespace apachearrow {
3030
int64_t* out) const override {
3131
size_t endptr;
3232
std::string val(s, s + length);
33-
int64_t value = std::stoll(static_cast<std::string>(val), &endptr, 10);
33+
int64_t value
34+
= std::stoll(static_cast<std::string>(val), &endptr, 10);
3435
if (endptr != length) {
3536
return false;
3637
} else {
@@ -51,7 +52,8 @@ namespace apachearrow {
5152
if (ARROW_PREDICT_FALSE(s[0] != '.')) {
5253
return false;
5354
}
54-
if (ARROW_PREDICT_FALSE(!arrow::internal::ParseUnsigned(s + 1, 3, &millis))) {
55+
if (ARROW_PREDICT_FALSE(
56+
!arrow::internal::ParseUnsigned(s + 1, 3, &millis))) {
5557
return false;
5658
}
5759

@@ -66,10 +68,12 @@ namespace apachearrow {
6668
ParseTZ(const char* s, std::chrono::hours* out) {
6769
uint8_t hours = 0;
6870

69-
if (ARROW_PREDICT_FALSE(s[0] != '+') && ARROW_PREDICT_FALSE(s[0] != '-')) {
71+
if (ARROW_PREDICT_FALSE(s[0] != '+')
72+
&& ARROW_PREDICT_FALSE(s[0] != '-')) {
7073
return false;
7174
}
72-
if (ARROW_PREDICT_FALSE(!arrow::internal::ParseUnsigned(s + 1, 2, &hours))) {
75+
if (ARROW_PREDICT_FALSE(
76+
!arrow::internal::ParseUnsigned(s + 1, 2, &hours))) {
7377
return false;
7478
}
7579

@@ -97,12 +101,14 @@ namespace apachearrow {
97101
// "YYYY-MM-DD[ T]hh:mm:ss.sss"
98102
arrow_vendored::date::year_month_day ymd;
99103
if (ARROW_PREDICT_FALSE(
100-
!arrow::internal::detail::ParseYYYY_MM_DD(s, &ymd))) {
104+
!arrow::internal::detail::ParseYYYY_MM_DD(
105+
s, &ymd))) {
101106
return false;
102107
}
103108
std::chrono::seconds seconds;
104-
if (ARROW_PREDICT_FALSE(!arrow::internal::detail::ParseHH_MM_SS(
105-
s + 11, &seconds))) {
109+
if (ARROW_PREDICT_FALSE(
110+
!arrow::internal::detail::ParseHH_MM_SS(
111+
s + 11, &seconds))) {
106112
return false;
107113
}
108114
std::chrono::milliseconds millis;
@@ -111,18 +117,21 @@ namespace apachearrow {
111117
}
112118

113119
*out = arrow::internal::detail::ConvertTimePoint(
114-
arrow_vendored::date::sys_days(ymd) + seconds + millis, unit);
120+
arrow_vendored::date::sys_days(ymd) + seconds + millis,
121+
unit);
115122
return true;
116123
} else if (length == 25) {
117124
// "2008-09-15[ T]15:53:00+05:00"
118125
arrow_vendored::date::year_month_day ymd;
119126
if (ARROW_PREDICT_FALSE(
120-
!arrow::internal::detail::ParseYYYY_MM_DD(s, &ymd))) {
127+
!arrow::internal::detail::ParseYYYY_MM_DD(
128+
s, &ymd))) {
121129
return false;
122130
}
123131
std::chrono::seconds seconds;
124-
if (ARROW_PREDICT_FALSE(!arrow::internal::detail::ParseHH_MM_SS(
125-
s + 11, &seconds))) {
132+
if (ARROW_PREDICT_FALSE(
133+
!arrow::internal::detail::ParseHH_MM_SS(
134+
s + 11, &seconds))) {
126135
return false;
127136
}
128137
std::chrono::hours tz;
@@ -131,7 +140,8 @@ namespace apachearrow {
131140
}
132141

133142
*out = arrow::internal::detail::ConvertTimePoint(
134-
arrow_vendored::date::sys_days(ymd) + tz + seconds, unit);
143+
arrow_vendored::date::sys_days(ymd) + tz + seconds,
144+
unit);
135145
return true;
136146
}
137147
return false;
@@ -148,7 +158,8 @@ namespace apachearrow {
148158
std::vector<std::shared_ptr<arrow::TimestampParser>> DATE_PARSERS{
149159
std::make_shared<CustomISO8601Parser>(),
150160
arrow::TimestampParser::MakeStrptime("%Y-%m-%d\\D%H:%M:%S.%f"),
151-
arrow::TimestampParser::MakeStrptime("%m/%d/%Y, %I:%M:%S %p"), // US locale string
161+
arrow::TimestampParser::MakeStrptime(
162+
"%m/%d/%Y, %I:%M:%S %p"), // US locale string
152163
arrow::TimestampParser::MakeStrptime("%m-%d-%Y"),
153164
arrow::TimestampParser::MakeStrptime("%m/%d/%Y"),
154165
arrow::TimestampParser::MakeStrptime("%d %m %Y"),
@@ -159,7 +170,8 @@ namespace apachearrow {
159170
std::make_shared<UnixTimestampParser>(),
160171
std::make_shared<CustomISO8601Parser>(),
161172
arrow::TimestampParser::MakeStrptime("%Y-%m-%d\\D%H:%M:%S.%f"),
162-
arrow::TimestampParser::MakeStrptime("%m/%d/%Y, %I:%M:%S %p"), // US locale string
173+
arrow::TimestampParser::MakeStrptime(
174+
"%m/%d/%Y, %I:%M:%S %p"), // US locale string
163175
arrow::TimestampParser::MakeStrptime("%m-%d-%Y"),
164176
arrow::TimestampParser::MakeStrptime("%m/%d/%Y"),
165177
arrow::TimestampParser::MakeStrptime("%d %m %Y"),
@@ -169,8 +181,8 @@ namespace apachearrow {
169181
parseAsArrowTimestamp(const std::string& input) {
170182
for (auto candidate : DATE_PARSERS) {
171183
int64_t datetime;
172-
if (candidate->operator()(
173-
input.c_str(), input.size(), arrow::TimeUnit::MILLI, &datetime)) {
184+
if (candidate->operator()(input.c_str(), input.size(),
185+
arrow::TimeUnit::MILLI, &datetime)) {
174186
return datetime;
175187
}
176188
}

0 commit comments

Comments
 (0)