From 38230a1535bcc8fdf7b694b1b8cf5df9ad9ef4ef Mon Sep 17 00:00:00 2001 From: Jonathan Tatum Date: Thu, 9 Jan 2025 13:15:29 -0800 Subject: [PATCH] Remove references to now unused option use_legacy_container_builders. After changes to the list builder implementation to consolidate the legacy and modern versions, use_legacy_container_builders no longer has any effect. PiperOrigin-RevId: 713773190 --- eval/public/cel_options.cc | 3 +-- eval/public/cel_options.h | 9 --------- runtime/optional_types_test.cc | 2 -- runtime/runtime_builder_factory.cc | 4 ---- runtime/runtime_options.h | 9 --------- runtime/type_registry.h | 1 - 6 files changed, 1 insertion(+), 27 deletions(-) diff --git a/eval/public/cel_options.cc b/eval/public/cel_options.cc index ce95cb2e8..65b6517e7 100644 --- a/eval/public/cel_options.cc +++ b/eval/public/cel_options.cc @@ -39,8 +39,7 @@ cel::RuntimeOptions ConvertToRuntimeOptions(const InterpreterOptions& options) { options.enable_empty_wrapper_null_unboxing, options.enable_lazy_bind_initialization, options.max_recursion_depth, - options.enable_recursive_tracing, - options.use_legacy_container_builders}; + options.enable_recursive_tracing}; } } // namespace google::api::expr::runtime diff --git a/eval/public/cel_options.h b/eval/public/cel_options.h index 89e62e42f..f6a002996 100644 --- a/eval/public/cel_options.h +++ b/eval/public/cel_options.h @@ -183,15 +183,6 @@ struct InterpreterOptions { // Unlike the stack machine implementation, supporting tracing can affect // performance whether or not tracing is requested for a given evaluation. bool enable_recursive_tracing = false; - - // Use legacy containers for lists and maps when possible. - // - // For interoperating with legacy APIs, it can be more efficient to maintain - // the list/map representation as CelValues. Requires using an Arena, - // otherwise modern implementations are used. - // - // Default is true for the legacy options type. - bool use_legacy_container_builders = true; }; // LINT.ThenChange(//depot/google3/runtime/runtime_options.h) diff --git a/runtime/optional_types_test.cc b/runtime/optional_types_test.cc index 803a8d7a3..0f5e42e39 100644 --- a/runtime/optional_types_test.cc +++ b/runtime/optional_types_test.cc @@ -187,7 +187,6 @@ class OptionalTypesTest TEST_P(OptionalTypesTest, RecursivePlan) { RuntimeOptions opts; - opts.use_legacy_container_builders = false; opts.enable_qualified_type_identifiers = true; opts.max_recursion_depth = -1; opts.short_circuiting = EnableShortCircuiting(); @@ -223,7 +222,6 @@ TEST_P(OptionalTypesTest, RecursivePlan) { TEST_P(OptionalTypesTest, Defaults) { RuntimeOptions opts; - opts.use_legacy_container_builders = false; opts.enable_qualified_type_identifiers = true; opts.short_circuiting = EnableShortCircuiting(); const EvaluateResultTestCase& test_case = GetTestCase(); diff --git a/runtime/runtime_builder_factory.cc b/runtime/runtime_builder_factory.cc index cdfb0058f..9d9d14b6e 100644 --- a/runtime/runtime_builder_factory.cc +++ b/runtime/runtime_builder_factory.cc @@ -26,7 +26,6 @@ #include "runtime/internal/runtime_impl.h" #include "runtime/runtime_builder.h" #include "runtime/runtime_options.h" -#include "runtime/type_registry.h" #include "google/protobuf/descriptor.h" namespace cel { @@ -63,9 +62,6 @@ absl::StatusOr CreateRuntimeBuilder( auto& type_registry = runtime_impl->type_registry(); auto& function_registry = runtime_impl->function_registry(); - type_registry.set_use_legacy_container_builders( - options.use_legacy_container_builders); - return RuntimeBuilder(type_registry, function_registry, std::move(runtime_impl)); } diff --git a/runtime/runtime_options.h b/runtime/runtime_options.h index 9d8cfcefd..c038475c5 100644 --- a/runtime/runtime_options.h +++ b/runtime/runtime_options.h @@ -153,15 +153,6 @@ struct RuntimeOptions { // Unlike the stack machine implementation, supporting tracing can affect // performance whether or not tracing is requested for a given evaluation. bool enable_recursive_tracing = false; - - // Use legacy containers for lists and maps when possible. - // - // For interoperating with legacy APIs, it can be more efficient to maintain - // the list/map representation as CelValues. Requires using an Arena, - // otherwise modern implementations are used. - // - // Default is false for the modern option type. - bool use_legacy_container_builders = false; }; // LINT.ThenChange(//depot/google3/eval/public/cel_options.h) diff --git a/runtime/type_registry.h b/runtime/type_registry.h index 61a0b2b2d..8f3c9b06d 100644 --- a/runtime/type_registry.h +++ b/runtime/type_registry.h @@ -91,7 +91,6 @@ class TypeRegistry { // Returns the effective type provider. const TypeProvider& GetComposedTypeProvider() const { return type_provider_; } - void set_use_legacy_container_builders(bool use_legacy_container_builders) {} private: friend const runtime_internal::RuntimeTypeProvider&