Skip to content

Commit 070dfcb

Browse files
jnthntatumcopybara-github
authored andcommitted
Refactor select step impl to behave consistently between iterative and recursive programs.
PiperOrigin-RevId: 949647076
1 parent 2491ba9 commit 070dfcb

4 files changed

Lines changed: 149 additions & 251 deletions

File tree

eval/compiler/flat_expr_builder.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -976,14 +976,14 @@ class FlatExprVisitor : public cel::AstVisitor {
976976
return;
977977
}
978978

979+
StringValue field = cel::StringValue(select_expr.field());
979980
if (auto depth = RecursionEligible(); depth.has_value()) {
980981
auto deps = ExtractRecursiveDependencies();
981982
if (deps.size() != 1) {
982983
SetProgressStatusIfError(absl::InternalError(
983984
"unexpected number of dependencies for select operation."));
984985
return;
985986
}
986-
StringValue field = cel::StringValue(select_expr.field());
987987

988988
SetRecursiveStep(
989989
CreateDirectSelectStep(std::move(deps[0]), std::move(field),
@@ -994,9 +994,9 @@ class FlatExprVisitor : public cel::AstVisitor {
994994
return;
995995
}
996996

997-
AddStep(CreateSelectStep(select_expr, expr.id(),
998-
options_.enable_empty_wrapper_null_unboxing,
999-
enable_optional_types_));
997+
AddStep(CreateSelectStep(
998+
std::move(field), select_expr.test_only(), expr.id(),
999+
options_.enable_empty_wrapper_null_unboxing, enable_optional_types_));
10001000
}
10011001

10021002
// Call node handler group.

0 commit comments

Comments
 (0)