Skip to content

get_plan async

get_plan(
    mapping: MappingList,
    source: CatalogEntry,
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    sinks: Optional[CatalogEntries] = None,
    location: Optional[Location] = None,
    language: Optional[Language] = None,
    additional_plan_options_map: Optional[AdditionalPlanOptionsMap] = None,
) -> GetPlanResponse

Gets code to perform a specified mapping.

Parameters:

  • mapping (MappingList) –

    The list of mappings from a source table to target tables.

  • source (CatalogEntry) –

    The source table.

  • sinks (Optional[CatalogEntries], default: None ) –

    The target tables.

  • location (Optional[Location], default: None ) –

    The parameters for the mapping.

  • language (Optional[Language], default: None ) –

    The programming language of the code to perform the mapping.

  • additional_plan_options_map (Optional[AdditionalPlanOptionsMap], default: None ) –

    A map to hold additional optional key-value parameters.

    Currently, these key-value pairs are supported:

    • inferSchema — Specifies whether to set inferSchema to true or false for the default script generated by an Glue job. For example, to set inferSchema to true, pass the following key value pair:

      --additional-plan-options-map '{"inferSchema":"true"}'

Raises:

Source code in docs_src/capo_glue/_services/async_glue.py
async def get_plan(
    self,
    mapping: "capo_glue.types.mapping_list.MappingList",
    source: "capo_glue.types.catalog_entry.CatalogEntry",
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    sinks: Optional["capo_glue.types.catalog_entries.CatalogEntries"] = None,
    location: Optional["capo_glue.types.location.Location"] = None,
    language: Optional["capo_glue.types.language.Language"] = None,
    additional_plan_options_map: Optional[
        "capo_glue.types.additional_plan_options_map.AdditionalPlanOptionsMap"
    ] = None,
) -> "capo_glue.types.get_plan_response.GetPlanResponse":
    """<p>Gets code to perform a specified mapping.</p>

    Args:
        mapping: <p>The list of mappings from a source table to target tables.</p>
        source: <p>The source table.</p>
        sinks: <p>The target tables.</p>
        location: <p>The parameters for the mapping.</p>
        language: <p>The programming language of the code to perform the mapping.</p>
        additional_plan_options_map: <p>A map to hold additional optional key-value parameters.</p> <p>Currently, these key-value pairs are supported:</p> <ul> <li> <p> <code>inferSchema</code> — Specifies whether to set <code>inferSchema</code> to true or false for the default script generated by an Glue job. For example, to set <code>inferSchema</code> to true, pass the following key value pair:</p> <p> <code>--additional-plan-options-map '{"inferSchema":"true"}'</code> </p> </li> </ul>

    Raises:
        capo_glue.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_glue.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_glue.types.get_plan_request.GetPlanRequest]",
    ) -> AsyncOperationResponse[
        "capo_glue.types.get_plan_response.GetPlanResponse"
    ]:
        import capo_glue._operations.aws_glue.get_plan

        (
            output,
            http_response,
        ) = await capo_glue._operations.aws_glue.get_plan.async_get_plan(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetPlan")
    )
    input_: capo_glue.types.get_plan_request.GetPlanRequest = {
        "mapping": mapping,
        "source": source,
    }
    if sinks is not None:
        input_["sinks"] = sinks
    if location is not None:
        input_["location"] = location
    if language is not None:
        input_["language"] = language
    if additional_plan_options_map is not None:
        input_["additional_plan_options_map"] = additional_plan_options_map

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