Skip to content

update_user_defined_function

update_user_defined_function(
    database_name: NameString,
    function_name: NameString,
    function_input: UserDefinedFunctionInput,
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    catalog_id: Optional[CatalogIdString] = None,
) -> UpdateUserDefinedFunctionResponse

Updates an existing function definition in the Data Catalog.

Parameters:

  • catalog_id (Optional[CatalogIdString], default: None ) –

    The ID of the Data Catalog where the function to be updated is located. If none is provided, the Amazon Web Services account ID is used by default.

  • database_name (NameString) –

    The name of the catalog database where the function to be updated is located.

  • function_name (NameString) –

    The name of the function.

  • function_input (UserDefinedFunctionInput) –

    A FunctionInput object that redefines the function in the Data Catalog.

Raises:

Source code in docs_src/capo_glue/_services/glue.py
def update_user_defined_function(
    self,
    database_name: "capo_glue.types.name_string.NameString",
    function_name: "capo_glue.types.name_string.NameString",
    function_input: "capo_glue.types.user_defined_function_input.UserDefinedFunctionInput",
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    catalog_id: Optional[
        "capo_glue.types.catalog_id_string.CatalogIdString"
    ] = None,
) -> "capo_glue.types.update_user_defined_function_response.UpdateUserDefinedFunctionResponse":
    """<p>Updates an existing function definition in the Data Catalog.</p>

    Args:
        catalog_id: <p>The ID of the Data Catalog where the function to be updated is located. If none is provided, the Amazon Web Services account ID is used by default.</p>
        database_name: <p>The name of the catalog database where the function to be updated is located.</p>
        function_name: <p>The name of the function.</p>
        function_input: <p>A <code>FunctionInput</code> object that redefines the function in the Data Catalog.</p>

    Raises:
        capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</p>
        capo_glue.errors.glue_encryption_exception.GlueEncryptionException: <p>An encryption operation failed.</p>
        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.
    """

    def _handler(
        req: "OperationRequest[capo_glue.types.update_user_defined_function_request.UpdateUserDefinedFunctionRequest]",
    ) -> OperationResponse[
        "capo_glue.types.update_user_defined_function_response.UpdateUserDefinedFunctionResponse"
    ]:
        import capo_glue._operations.aws_glue.update_user_defined_function

        output, http_response = (
            capo_glue._operations.aws_glue.update_user_defined_function.update_user_defined_function(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateUserDefinedFunction")
    )
    input_: capo_glue.types.update_user_defined_function_request.UpdateUserDefinedFunctionRequest = {
        "database_name": database_name,
        "function_name": function_name,
        "function_input": function_input,
    }
    if catalog_id is not None:
        input_["catalog_id"] = catalog_id

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