Beispiel #1
0
    def get_executions_by_context(
            self, context_id: int) -> List[metadata_store_pb2.Execution]:
        """Gets all direct executions that a context associates with.

    Args:
      context_id: The id of the querying context

    Returns:
      Executions associating with the context.
    """
        request = metadata_store_service_pb2.GetExecutionsByContextRequest()
        request.context_id = context_id
        request.options.max_result_size = 100
        request.options.order_by_field.field = (
            metadata_store_pb2.ListOperationOptions.OrderByField.Field.
            CREATE_TIME)
        request.options.order_by_field.is_asc = False

        result = []
        while True:
            response = metadata_store_service_pb2.GetExecutionsByContextResponse(
            )
            self._call('GetExecutionsByContext', request, response)
            for x in response.executions:
                result.append(x)

            if not response.next_page_token:
                break

            request.options.next_page_token = response.next_page_token

        return result
Beispiel #2
0
 def _get_executions_by_pipeline_name(
         self, pipeline_name: Text) -> List[metadata_store_pb2.Execution]:
     """Helper function returns executions under a given pipeline name."""
     # step 1: get context id by context name
     request = metadata_store_service_pb2.GetContextByTypeAndNameRequest(
         type_name='pipeline', context_name=pipeline_name)
     context_id = self._stub.GetContextByTypeAndName(request).context.id
     # step 2: get executions by context id
     request = metadata_store_service_pb2.GetExecutionsByContextRequest(
         context_id=context_id)
     return self._stub.GetExecutionsByContext(request).executions
Beispiel #3
0
    def get_executions_by_context(
            self, context_id: int) -> List[metadata_store_pb2.Execution]:
        """Gets all direct executions that a context associates with.

    Args:
      context_id: The id of the querying context

    Returns:
      Executions associating with the context.
    """
        request = metadata_store_service_pb2.GetExecutionsByContextRequest()
        request.context_id = context_id
        response = metadata_store_service_pb2.GetExecutionsByContextResponse()

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