Skip to content

get_work_unit_results async

get_work_unit_results(
    query_id: GetWorkUnitResultsRequestQueryIdString,
    work_unit_id: GetWorkUnitResultsRequestWorkUnitIdLong,
    work_unit_token: SyntheticGetWorkUnitResultsRequestWorkUnitTokenString,
    *,
    config_overrides: Optional[AsyncLakeFormationClientConfig] = None,
) -> AsyncGenerator[GetWorkUnitResultsResponse]

Returns the work units resulting from the query. Work units can be executed in any order and in parallel.

Parameters:

Raises:

Source code in docs_src/capo_lakeformation/_services/async_lake_formation.py
@asynccontextmanager
async def get_work_unit_results(
    self,
    query_id: "capo_lakeformation.types.get_work_unit_results_request_query_id_string.GetWorkUnitResultsRequestQueryIdString",
    work_unit_id: "capo_lakeformation.types.get_work_unit_results_request_work_unit_id_long.GetWorkUnitResultsRequestWorkUnitIdLong",
    work_unit_token: "capo_lakeformation.types.synthetic_get_work_unit_results_request_work_unit_token_string.SyntheticGetWorkUnitResultsRequestWorkUnitTokenString",
    *,
    config_overrides: Optional[AsyncLakeFormationClientConfig] = None,
) -> "AsyncGenerator[capo_lakeformation.types.get_work_unit_results_response.GetWorkUnitResultsResponse]":
    """<p>Returns the work units resulting from the query. Work units can be executed in any order and in parallel. </p>

    Args:
        query_id: <p>The ID of the plan query operation for which to get results.</p>
        work_unit_id: <p>The work unit ID for which to get results. Value generated by enumerating <code>WorkUnitIdMin</code> to <code>WorkUnitIdMax</code> (inclusive) from the <code>WorkUnitRange</code> in the output of <code>GetWorkUnits</code>.</p>
        work_unit_token: <p>A work token used to query the execution service. Token output from <code>GetWorkUnits</code>.</p>

    Raises:
        capo_lakeformation.errors.access_denied_exception.AccessDeniedException: <p>Access to a resource was denied.</p>
        capo_lakeformation.errors.expired_exception.ExpiredException: <p>Contains details about an error where the query request expired.</p>
        capo_lakeformation.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_lakeformation.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_lakeformation.errors.throttled_exception.ThrottledException: <p>Contains details about an error where the query request was throttled.</p>
        capo_lakeformation.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lakeformation.types.get_work_unit_results_request.GetWorkUnitResultsRequest]",
    ) -> AsyncOperationResponse[
        "capo_lakeformation.types.get_work_unit_results_response.GetWorkUnitResultsResponse"
    ]:
        import capo_lakeformation._operations.aws_lake_formation.get_work_unit_results

        (
            output,
            http_response,
        ) = await capo_lakeformation._operations.aws_lake_formation.get_work_unit_results.async_get_work_unit_results(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_lakeformation.types.get_work_unit_results_request.GetWorkUnitResultsRequest",
    ) -> dict[str, Any]:
        import capo_lakeformation.types.get_work_unit_results_request

        return (
            capo_lakeformation.types.get_work_unit_results_request.redact_sensitive(
                input_
            )
        )

    def _redact_output(
        output: "capo_lakeformation.types.get_work_unit_results_response.GetWorkUnitResultsResponse",
    ) -> dict[str, Any]:
        import capo_lakeformation.types.get_work_unit_results_response

        return capo_lakeformation.types.get_work_unit_results_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GetWorkUnitResults",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_lakeformation.types.get_work_unit_results_request.GetWorkUnitResultsRequest = {
        "query_id": query_id,
        "work_unit_id": work_unit_id,
        "work_unit_token": work_unit_token,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    try:
        yield response.output
    finally:
        await response.response.aclose()