Skip to content

update_schema

update_schema(
    schema_id: SchemaId,
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    schema_version_number: Optional[SchemaVersionNumber] = None,
    compatibility: Optional[Compatibility] = None,
    description: Optional[DescriptionString] = None,
) -> UpdateSchemaResponse

Updates the description, compatibility setting, or version checkpoint for a schema set.

For updating the compatibility setting, the call will not validate compatibility for the entire set of schema versions with the new compatibility setting. If the value for Compatibility is provided, the VersionNumber (a checkpoint) is also required. The API will validate the checkpoint version number for consistency.

If the value for the VersionNumber (checkpoint) is provided, Compatibility is optional and this can be used to set/reset a checkpoint for the schema.

This update will happen only if the schema is in the AVAILABLE state.

Parameters:

  • schema_id (SchemaId) –

    This is a wrapper structure to contain schema identity fields. The structure contains:

    • SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. One of SchemaArn or SchemaName has to be provided.

    • SchemaId$SchemaName: The name of the schema. One of SchemaArn or SchemaName has to be provided.

  • schema_version_number (Optional[SchemaVersionNumber], default: None ) –

    Version number required for check pointing. One of VersionNumber or Compatibility has to be provided.

  • compatibility (Optional[Compatibility], default: None ) –

    The new compatibility setting for the schema.

  • description (Optional[DescriptionString], default: None ) –

    The new description for the schema.

Raises:

Source code in docs_src/capo_glue/_services/glue.py
def update_schema(
    self,
    schema_id: "capo_glue.types.schema_id.SchemaId",
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    schema_version_number: Optional[
        "capo_glue.types.schema_version_number.SchemaVersionNumber"
    ] = None,
    compatibility: Optional["capo_glue.types.compatibility.Compatibility"] = None,
    description: Optional[
        "capo_glue.types.description_string.DescriptionString"
    ] = None,
) -> "capo_glue.types.update_schema_response.UpdateSchemaResponse":
    """<p>Updates the description, compatibility setting, or version checkpoint for a schema set.</p> <p>For updating the compatibility setting, the call will not validate compatibility for the entire set of schema versions with the new compatibility setting. If the value for <code>Compatibility</code> is provided, the <code>VersionNumber</code> (a checkpoint) is also required. The API will validate the checkpoint version number for consistency.</p> <p>If the value for the <code>VersionNumber</code> (checkpoint) is provided, <code>Compatibility</code> is optional and this can be used to set/reset a checkpoint for the schema.</p> <p>This update will happen only if the schema is in the AVAILABLE state.</p>

    Args:
        schema_id: <p>This is a wrapper structure to contain schema identity fields. The structure contains:</p> <ul> <li> <p>SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. One of <code>SchemaArn</code> or <code>SchemaName</code> has to be provided.</p> </li> <li> <p>SchemaId$SchemaName: The name of the schema. One of <code>SchemaArn</code> or <code>SchemaName</code> has to be provided.</p> </li> </ul>
        schema_version_number: <p>Version number required for check pointing. One of <code>VersionNumber</code> or <code>Compatibility</code> has to be provided.</p>
        compatibility: <p>The new compatibility setting for the schema.</p>
        description: <p>The new description for the schema.</p>

    Raises:
        capo_glue.errors.access_denied_exception.AccessDeniedException: <p>Access to a resource was denied.</p>
        capo_glue.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Two processes are trying to modify a resource simultaneously.</p>
        capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</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.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_glue.types.update_schema_input.UpdateSchemaInput]",
    ) -> OperationResponse[
        "capo_glue.types.update_schema_response.UpdateSchemaResponse"
    ]:
        import capo_glue._operations.aws_glue.update_schema

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateSchema")
    )
    input_: capo_glue.types.update_schema_input.UpdateSchemaInput = {
        "schema_id": schema_id
    }
    if schema_version_number is not None:
        input_["schema_version_number"] = schema_version_number
    if compatibility is not None:
        input_["compatibility"] = compatibility
    if description is not None:
        input_["description"] = description

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