Skip to content

Commit

Permalink
1. Use new open and close delimiters in pretty_print.cc.
Browse files Browse the repository at this point in the history
2. Fix typo (`open` should use `"[]"` and `close` should use `"]"`.
  • Loading branch information
kevingurney committed Oct 10, 2023
1 parent 07c12b9 commit 874d05d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions cpp/src/arrow/pretty_print.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void PrettyPrinter::OpenArray(const Array& array) {
if (!options_.skip_new_lines) {
Indent();
}
(*sink_) << "[";
(*sink_) << options_.array_delimiters.open;
if (array.length() > 0) {
Newline();
indent_ += options_.indent_size;
Expand All @@ -101,7 +101,7 @@ void PrettyPrinter::CloseArray(const Array& array) {
Indent();
}
}
(*sink_) << "]";
(*sink_) << options_.array_delimiters.close;
}

void PrettyPrinter::Write(std::string_view data) { (*sink_) << data; }
Expand Down Expand Up @@ -449,7 +449,7 @@ Status PrettyPrint(const ChunkedArray& chunked_arr, const PrettyPrintOptions& op
for (int i = 0; i < indent; ++i) {
(*sink) << " ";
}
(*sink) << "[";
(*sink) << options.chunked_array_delimiters.open;
if (!skip_new_lines) {
*sink << "\n";
}
Expand Down Expand Up @@ -488,7 +488,7 @@ Status PrettyPrint(const ChunkedArray& chunked_arr, const PrettyPrintOptions& op
for (int i = 0; i < indent; ++i) {
(*sink) << " ";
}
(*sink) << "]";
(*sink) << options.chunked_array_delimiters.close;

return Status::OK();
}
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/pretty_print.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ class Table;
/// an Array or ChunkedArray.
struct ARROW_EXPORT PrettyPrintDelimiters {
/// Delimiter to use when opening an Array or ChunkedArray (e.g. "[")
std::string open = "]";
std::string open = "[";

/// Delimiter to use when closing an Array or ChunkedArray (e.g. "]")
std::string close = "[";
std::string close = "]";

/// Delimiter for separating individual elements of an Array (e.g. ","),
/// or individual chunks of a ChunkedArray
Expand Down

0 comments on commit 874d05d

Please sign in to comment.