Skip to content

list_calculation_executions

list_calculation_executions(
    session_id: SessionId,
    *,
    config_overrides: Optional[AthenaClientConfig] = None,
    state_filter: Optional[CalculationExecutionState] = None,
    max_results: Optional[MaxCalculationsCount] = None,
    next_token: Optional[SessionManagerToken] = None,
) -> ListCalculationExecutionsResponse

Lists the calculations that have been submitted to a session in descending order. Newer calculations are listed first; older calculations are listed later.

Parameters:

  • session_id (SessionId) –

    The session ID.

  • state_filter (Optional[CalculationExecutionState], default: None ) –

    A filter for a specific calculation execution state. A description of each state follows.

    CREATING - The calculation is in the process of being created.

    CREATED - The calculation has been created and is ready to run.

    QUEUED - The calculation has been queued for processing.

    RUNNING - The calculation is running.

    CANCELING - A request to cancel the calculation has been received and the system is working to stop it.

    CANCELED - The calculation is no longer running as the result of a cancel request.

    COMPLETED - The calculation has completed without error.

    FAILED - The calculation failed and is no longer running.

  • max_results (Optional[MaxCalculationsCount], default: None ) –

    The maximum number of calculation executions to return.

  • next_token (Optional[SessionManagerToken], default: None ) –

    A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

Raises:

Source code in docs_src/capo_athena/_services/athena.py
def list_calculation_executions(
    self,
    session_id: "capo_athena.types.session_id.SessionId",
    *,
    config_overrides: Optional[AthenaClientConfig] = None,
    state_filter: Optional[
        "capo_athena.types.calculation_execution_state.CalculationExecutionState"
    ] = None,
    max_results: Optional[
        "capo_athena.types.max_calculations_count.MaxCalculationsCount"
    ] = None,
    next_token: Optional[
        "capo_athena.types.session_manager_token.SessionManagerToken"
    ] = None,
) -> "capo_athena.types.list_calculation_executions_response.ListCalculationExecutionsResponse":
    """<p>Lists the calculations that have been submitted to a session in descending order. Newer calculations are listed first; older calculations are listed later.</p>

    Args:
        session_id: <p>The session ID.</p>
        state_filter: <p>A filter for a specific calculation execution state. A description of each state follows.</p> <p> <code>CREATING</code> - The calculation is in the process of being created.</p> <p> <code>CREATED</code> - The calculation has been created and is ready to run.</p> <p> <code>QUEUED</code> - The calculation has been queued for processing.</p> <p> <code>RUNNING</code> - The calculation is running.</p> <p> <code>CANCELING</code> - A request to cancel the calculation has been received and the system is working to stop it.</p> <p> <code>CANCELED</code> - The calculation is no longer running as the result of a cancel request.</p> <p> <code>COMPLETED</code> - The calculation has completed without error.</p> <p> <code>FAILED</code> - The calculation failed and is no longer running.</p>
        max_results: <p>The maximum number of calculation executions to return.</p>
        next_token: <p>A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the <code>NextToken</code> from the response object of the previous page call.</p>

    Raises:
        capo_athena.errors.internal_server_exception.InternalServerException: <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
        capo_athena.errors.invalid_request_exception.InvalidRequestException: <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
        capo_athena.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource, such as a workgroup, was not found.</p>
        capo_athena.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_athena.types.list_calculation_executions_request.ListCalculationExecutionsRequest]",
    ) -> OperationResponse[
        "capo_athena.types.list_calculation_executions_response.ListCalculationExecutionsResponse"
    ]:
        import capo_athena._operations.amazon_athena.list_calculation_executions

        output, http_response = (
            capo_athena._operations.amazon_athena.list_calculation_executions.list_calculation_executions(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListCalculationExecutions")
    )
    input_: capo_athena.types.list_calculation_executions_request.ListCalculationExecutionsRequest = {
        "session_id": session_id
    }
    if state_filter is not None:
        input_["state_filter"] = state_filter
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output