From 874d05dc7331d4f4df5336060bc56d728d23883b Mon Sep 17 00:00:00 2001 From: Kevin Gurney Date: Tue, 10 Oct 2023 13:03:15 -0400 Subject: [PATCH] 1. Use new `open` and `close` delimiters in `pretty_print.cc`. 2. Fix typo (`open` should use `"[]"` and `close` should use `"]"`. --- cpp/src/arrow/pretty_print.cc | 8 ++++---- cpp/src/arrow/pretty_print.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpp/src/arrow/pretty_print.cc b/cpp/src/arrow/pretty_print.cc index a4a1fa90c2878..a5410df7e9ae2 100644 --- a/cpp/src/arrow/pretty_print.cc +++ b/cpp/src/arrow/pretty_print.cc @@ -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; @@ -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; } @@ -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"; } @@ -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(); } diff --git a/cpp/src/arrow/pretty_print.h b/cpp/src/arrow/pretty_print.h index c2000647a0e09..ad68726716cc7 100644 --- a/cpp/src/arrow/pretty_print.h +++ b/cpp/src/arrow/pretty_print.h @@ -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