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
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