Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON writer: avoid default stream use in string_scalar constructors #14444

Merged
Merged
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
10 changes: 7 additions & 3 deletions cpp/src/io/json/write_json.cu
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,9 @@ struct column_to_strings_fn {
struct_row_end_wrap("}", true, stream),
list_value_separator(",", true, stream),
list_row_begin_wrap("[", true, stream),
list_row_end_wrap("]", true, stream)
list_row_end_wrap("]", true, stream),
true_value(options_.get_true_value(), true, stream),
false_value(options_.get_false_value(), true, stream)
{
}

Expand All @@ -526,8 +528,7 @@ struct column_to_strings_fn {
std::enable_if_t<std::is_same_v<column_type, bool>, std::unique_ptr<column>> operator()(
column_view const& column) const
{
return cudf::strings::detail::from_booleans(
column, options_.get_true_value(), options_.get_false_value(), stream_, mr_);
return cudf::strings::detail::from_booleans(column, true_value, false_value, stream_, mr_);
}

// strings:
Expand Down Expand Up @@ -742,6 +743,9 @@ struct column_to_strings_fn {
string_scalar const list_value_separator; // ","
string_scalar const list_row_begin_wrap; // "["
string_scalar const list_row_end_wrap; // "]"
// bool converter constants
string_scalar const true_value;
string_scalar const false_value;
};

} // namespace
Expand Down