@@ -53,17 +53,15 @@ namespace cel_python {
5353
5454PyCelEnvInternal::PyCelEnvInternal (
5555 const PyCelEnvConfig& env_config, PyObject* py_descriptor_pool,
56- std::vector<CelExtensionHandle> extension_handles,
57- const std::string& container)
56+ std::vector<CelExtensionHandle> extension_handles)
5857 : env_config_(env_config),
5958 py_descriptor_database_ (py_descriptor_pool),
6059 descriptor_pool_(
6160 std::make_shared<google::protobuf::DescriptorPool>(&py_descriptor_database_)),
6261 message_factory_(descriptor_pool_.get()),
6362 py_message_factory_(
6463 std::make_shared<PyMessageFactory>(py_descriptor_pool)),
65- extensions_(std::move(extension_handles)),
66- container_(std::move(container)) {
64+ extensions_(std::move(extension_handles)) {
6765 cel_env_.SetDescriptorPool (descriptor_pool_);
6866 cel_env_.SetConfig (env_config_.GetConfig ());
6967 cel::RegisterStandardExtensions (cel_env_);
@@ -115,9 +113,10 @@ PyCelEnvInternal::NewCelEnvInternal(
115113 extension_handles.push_back (std::move (handle));
116114 }
117115
116+ config.SetContainerConfig (cel::Config::ContainerConfig{.name = container});
118117 return std::shared_ptr<PyCelEnvInternal>(
119118 new PyCelEnvInternal (PyCelEnvConfig (config), py_descriptor_pool,
120- std::move (extension_handles), container ));
119+ std::move (extension_handles)));
121120}
122121
123122absl::StatusOr<const cel::Compiler*> PyCelEnvInternal::GetCompiler (
@@ -128,15 +127,21 @@ absl::StatusOr<const cel::Compiler*> PyCelEnvInternal::GetCompiler(
128127 return env->compiler_ .get ();
129128 }
130129
130+ const cel::Config& config = env->env_config_ .GetConfig ();
131+
131132 CEL_PYTHON_ASSIGN_OR_RETURN (
132133 std::unique_ptr<cel::CompilerBuilder> compiler_builder,
133134 env->cel_env_ .NewCompilerBuilder ());
134- compiler_builder->GetCheckerBuilder ().set_container (env->container_ );
135+
136+ cel::TypeCheckerBuilder& checker_builder =
137+ compiler_builder->GetCheckerBuilder ();
138+
139+ checker_builder.set_container (config.GetContainerConfig ().name );
135140
136141 // Convert variable types from cel::TypeInfo to PyCelType.
137- google::protobuf::Arena* arena = compiler_builder-> GetCheckerBuilder () .arena ();
142+ google::protobuf::Arena* arena = checker_builder .arena ();
138143 for (const cel::Config::VariableConfig& variable_config :
139- env-> env_config_ . GetConfig () .GetVariableConfigs ()) {
144+ config .GetVariableConfigs ()) {
140145 CEL_PYTHON_ASSIGN_OR_RETURN (
141146 cel::Type cel_type,
142147 cel::TypeInfoToType (variable_config.type_info ,
@@ -156,7 +161,7 @@ absl::StatusOr<const cel::Runtime*> PyCelEnvInternal::GetRuntime(
156161 }
157162
158163 cel::RuntimeOptions& opts = env->cel_env_runtime_ .mutable_runtime_options ();
159- opts.container = env->container_ ;
164+ opts.container = env->GetEnvConfig (). GetConfig (). GetContainerConfig (). name ;
160165 opts.enable_empty_wrapper_null_unboxing = true ;
161166 opts.enable_qualified_type_identifiers = true ;
162167 opts.enable_timestamp_duration_overflow_errors = true ;
0 commit comments