westonpace commented on code in PR #14402:
URL: https://github.com/apache/arrow/pull/14402#discussion_r995153605
##########
cpp/src/arrow/engine/substrait/serde_test.cc:
##########
@@ -402,22 +402,36 @@ TEST(Substrait, SupportedLiterals) {
auto ExpectEq = [](std::string_view json, Datum expected_value) {
ARROW_SCOPED_TRACE(json);
- ASSERT_OK_AND_ASSIGN(
- auto buf, internal::SubstraitFromJSON("Expression",
- "{\"literal\":" +
std::string(json) + "}"));
- ExtensionSet ext_set;
- ASSERT_OK_AND_ASSIGN(auto expr, DeserializeExpression(*buf, ext_set));
+ for (bool nullable : {false, true}) {
+ std::string json_with_nullable;
+ std::string nullable_json = (nullable) ? ", \"nullable\": true" : "";
+ if (nullable) {
+ auto final_closing_brace = json.find_last_of('}');
+ ASSERT_NE(std::string_view::npos, final_closing_brace);
+ json_with_nullable =
+ std::string(json.substr(0, final_closing_brace)) + ",
\"nullable\": true}";
+ json = json_with_nullable;
+ }
Review Comment:
I've added the bool argument to `SubstraitFromJSON` and set it to false for
all unit test calls. To my pleasant surprise, my addition was the only new
failure. I removed `nullable_json`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]