def testExecutionInvocationPlaceholderSimple(self): placeholder_expression = """ operator { proto_op { expression { placeholder { type: EXEC_INVOCATION } } serialization_format: JSON } } """ pb = text_format.Parse(placeholder_expression, placeholder_pb2.PlaceholderExpression()) resolved = placeholder_utils.resolve_placeholder_expression( pb, self._resolution_context) got_exec_invocation = json_format.Parse( resolved, execution_invocation_pb2.ExecutionInvocation()) want_exec_invocation = text_format.Parse( _WANT_EXEC_INVOCATION, execution_invocation_pb2.ExecutionInvocation()) self.assertProtoEquals(want_exec_invocation, got_exec_invocation)
def to_proto(self) -> execution_invocation_pb2.ExecutionInvocation: return execution_invocation_pb2.ExecutionInvocation( execution_id=self.execution_id, input_dict=data_types_utils.build_artifact_struct_dict(self.input_dict), output_dict=data_types_utils.build_artifact_struct_dict( self.output_dict), execution_properties=data_types_utils.build_exec_property_value_dict( self.exec_properties), output_metadata_uri=self.execution_output_uri, stateful_working_dir=self.stateful_working_dir, tmp_dir=self.tmp_dir, pipeline_node=self.pipeline_node, pipeline_info=self.pipeline_info, pipeline_run_id=self.pipeline_run_id)
def to_proto(self) -> execution_invocation_pb2.ExecutionInvocation: return execution_invocation_pb2.ExecutionInvocation( execution_id=self.execution_id, input_dict=data_types_utils.build_artifact_struct_dict(self.input_dict), output_dict=data_types_utils.build_artifact_struct_dict( self.output_dict), # TODO(b/171794016): Deprecate execution_properties once # execution_properties_with_schema is used to build execution # properties. execution_properties=data_types_utils.build_metadata_value_dict( self.exec_properties), execution_properties_with_schema=data_types_utils .build_pipeline_value_dict(self.exec_properties), output_metadata_uri=self.execution_output_uri, stateful_working_dir=self.stateful_working_dir, tmp_dir=self.tmp_dir, pipeline_node=self.pipeline_node, pipeline_info=self.pipeline_info, pipeline_run_id=self.pipeline_run_id)