Skip to content

evaluate_expression

evaluate_expression(
    pipeline_id: id,
    object_id: id,
    expression: longString,
    *,
    config_overrides: Optional[DataPipelineClientConfig] = None,
) -> EvaluateExpressionOutput

Task runners call EvaluateExpression to evaluate a string in the context of the specified object. For example, a task runner can evaluate SQL queries stored in Amazon S3.

POST / HTTP/1.1 Content-Type: application/x-amz-json-1.1 X-Amz-Target: DataPipeline.DescribePipelines Content-Length: 164 Host: datapipeline.us-east-1.amazonaws.com X-Amz-Date: Mon, 12 Nov 2012 17:49:52 GMT Authorization: AuthParams {"pipelineId": "df-08785951KAKJEXAMPLE", "objectId": "Schedule", "expression": "Transform started at #{startDateTime} and finished at #{endDateTime}"} x-amzn-RequestId: 02870eb7-0736-11e2-af6f-6bc7a6be60d9 Content-Type: application/x-amz-json-1.1 Content-Length: 103 Date: Mon, 12 Nov 2012 17:50:53 GMT {"evaluatedExpression": "Transform started at 2012-12-12T00:00:00 and finished at 2012-12-21T18:00:00"}

Parameters:

  • pipeline_id (id) –

    The ID of the pipeline.

  • object_id (id) –

    The ID of the object.

  • expression (longString) –

    The expression to evaluate.

Raises:

Source code in docs_src/capo_data_pipeline/_services/data_pipeline.py
def evaluate_expression(
    self,
    pipeline_id: "capo_data_pipeline.types.id.id",
    object_id: "capo_data_pipeline.types.id.id",
    expression: "capo_data_pipeline.types.long_string.longString",
    *,
    config_overrides: Optional[DataPipelineClientConfig] = None,
) -> "capo_data_pipeline.types.evaluate_expression_output.EvaluateExpressionOutput":
    """<p>Task runners call <code>EvaluateExpression</code> to evaluate a string in the context of the specified object. For example, a task runner can evaluate SQL queries stored in Amazon S3.</p> <examples> <request> POST / HTTP/1.1 Content-Type: application/x-amz-json-1.1 X-Amz-Target: DataPipeline.DescribePipelines Content-Length: 164 Host: datapipeline.us-east-1.amazonaws.com X-Amz-Date: Mon, 12 Nov 2012 17:49:52 GMT Authorization: AuthParams {"pipelineId": "df-08785951KAKJEXAMPLE", "objectId": "Schedule", "expression": "Transform started at #{startDateTime} and finished at #{endDateTime}"} </request> <response> x-amzn-RequestId: 02870eb7-0736-11e2-af6f-6bc7a6be60d9 Content-Type: application/x-amz-json-1.1 Content-Length: 103 Date: Mon, 12 Nov 2012 17:50:53 GMT {"evaluatedExpression": "Transform started at 2012-12-12T00:00:00 and finished at 2012-12-21T18:00:00"} </response> </examples>

    Args:
        pipeline_id: <p>The ID of the pipeline.</p>
        object_id: <p>The ID of the object.</p>
        expression: <p>The expression to evaluate.</p>

    Raises:
        capo_data_pipeline.errors.internal_service_error.InternalServiceError: <p>An internal service error occurred.</p>
        capo_data_pipeline.errors.invalid_request_exception.InvalidRequestException: <p>The request was not valid. Verify that your request was properly formatted, that the signature was generated with the correct credentials, and that you haven't exceeded any of the service limits for your account.</p>
        capo_data_pipeline.errors.pipeline_deleted_exception.PipelineDeletedException: <p>The specified pipeline has been deleted.</p>
        capo_data_pipeline.errors.pipeline_not_found_exception.PipelineNotFoundException: <p>The specified pipeline was not found. Verify that you used the correct user and account identifiers.</p>
        capo_data_pipeline.errors.task_not_found_exception.TaskNotFoundException: <p>The specified task was not found. </p>
        capo_data_pipeline.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_data_pipeline.types.evaluate_expression_input.EvaluateExpressionInput]",
    ) -> OperationResponse[
        "capo_data_pipeline.types.evaluate_expression_output.EvaluateExpressionOutput"
    ]:
        import capo_data_pipeline._operations.data_pipeline.evaluate_expression

        output, http_response = (
            capo_data_pipeline._operations.data_pipeline.evaluate_expression.evaluate_expression(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("EvaluateExpression")
    )
    input_: capo_data_pipeline.types.evaluate_expression_input.EvaluateExpressionInput = {
        "pipeline_id": pipeline_id,
        "object_id": object_id,
        "expression": expression,
    }

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