You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose the environment's message types as .proto text #144
env.config().to_yaml() names each variable's message type, but not its fields, so the environment can't be shown in full:
uv run --no-project --with cel-expr-python==0.1.4 --with protobuf python - <<'EOF'from cel_expr_python import celfrom google.protobuf import descriptor_pb2, descriptor_poolfile = descriptor_pb2.FileDescriptorProto(name="probe.proto", package="probe", syntax="proto3")file.message_type.add(name="Row").field.add(name="text", number=1, type=9, label=1) # string text = 1;pool = descriptor_pool.DescriptorPool()pool.Add(file)env = cel.NewEnv(descriptor_pool=pool, variables={"self": cel.Type("probe.Row")})print(env.config().to_yaml()) # names the type probe.Row, but not its field text# variables:# - name: "self"# type: "probe.Row"EOF
Python's protobuf (upb) has no .proto printer, but the C++ protobuf this module links has one (FileDescriptor::DebugString()). Could the binding expose it, for example as the .proto text of each file the environment's types come from?
Activity