Example #1
0
    def put_executions(
            self,
            executions: Sequence[metadata_store_pb2.Execution]) -> List[int]:
        """Inserts or updates executions in the database.

    If an execution_id is specified for an execution, it is an update.
    If an execution_id is unspecified, it will insert a new execution.
    For new executions, type must be specified.
    For old executions, type must be unchanged or unspecified.
    When the name of an execution is given, it should be unique among
    executions of the same ExecutionType.

    Args:
      executions: A list of executions to insert or update.

    Returns:
      A list of execution ids index-aligned with the input.

    Raises:
      AlreadyExistsError: If execution's name is specified and it is already
        used by stored executions of that ExecutionType.
    """
        request = metadata_store_service_pb2.PutExecutionsRequest()
        for x in executions:
            request.executions.add().CopyFrom(x)
        response = metadata_store_service_pb2.PutExecutionsResponse()

        self._call('PutExecutions', request, response)
        result = []
        for x in response.execution_ids:
            result.append(x)
        return result
Example #2
0
    def put_executions(
            self,
            executions: Sequence[metadata_store_pb2.Execution]) -> List[int]:
        """Inserts or updates executions in the database.

    If an execution_id is specified for an execution, it is an update.
    If an execution_id is unspecified, it will insert a new execution.
    For new executions, type must be specified.
    For old executions, type must be unchanged or unspecified.

    Args:
      executions: A list of executions to insert or update.

    Returns:
      A list of execution ids index-aligned with the input.
    """
        request = metadata_store_service_pb2.PutExecutionsRequest()
        for x in executions:
            request.executions.add().CopyFrom(x)
        response = metadata_store_service_pb2.PutExecutionsResponse()

        self._call('PutExecutions', request, response)
        result = []
        for x in response.execution_ids:
            result.append(x)
        return result