class_docstr: A placeholder that evaluates to a proto message.
class_docstr_tok: ["A","placeholder","that","evaluates","to","a","proto","message","."]
docstr: Moves+deduplicates descriptors from sub-messages to the given `op`.
docstr_tok: ["Moves+deduplicates","descriptors","from","sub-messages","to","the","given","`","op","`","."]
code: def _lift_up_descriptors(
      self, op: placeholder_pb2.MakeProtoOperator
  ) -> None:
      """Moves+deduplicates descriptors from sub-messages to the given `op`."""
      known_descriptors = {fd.name for fd in op.file_descriptors.file}
      for field_value in op.fields.values():
          operator_type = field_value.operator.WhichOneof(
              "operator_type"
          )
          if operator_type == "list_concat_op":
              sub_expressions = (
                  field_value.operator.list_concat_op.expressions
              )
          elif operator_type == "make_dict_op":
              entries = field_value.operator.make_dict_op.entries
              sub_expressions = [entry.key for entry in entries] + [
                  entry.value for entry in entries
              ]
          else:
              sub_expressions = [field_value]
          for sub_expression in sub_expressions:
              if (
                  sub_expression.operator.WhichOneof("operator_type")
                  == "make_proto_op"
              ):
                  sub_op = sub_expression.operator.make_proto_op
                  for fd in sub_op.file_descriptors.file:
                      if fd.name not in known_descriptors:
                          known_descriptors.add(fd.name)
                          op.file_descriptors.file.append(fd)
                  sub_op.ClearField("file_descriptors")
  
file_path: tfx/tfx/dsl/placeholder/proto_placeholder.py
imports: from __future__ import annotations
  from typing import Dict, Generic, Iterator, List, Optional, Tuple, Type, TypeVar, Union
  from tfx.dsl.placeholder import placeholder_base
  from tfx.proto.orchestration import placeholder_pb2
  from tfx.utils import proto_utils
  from google.protobuf import any_pb2
  from google.protobuf import descriptor
  from google.protobuf import message
label_desc: Use image node_id 5 for calling the MakeProtoPlaceholder obj's underlying member method code with example usage: obj._lift_up_descriptors(op) without return types