def METHOD_NAME() -> None:
    """
    Test that custom error messages are extracted correctly with context.
    """
    msg = ": mismatched input 'fromm'. Expecting: "
    context = {"hostname": "foo"}
    result = DatabricksNativeEngineSpec.extract_errors(Exception(msg), context)
    assert result == [
        SupersetError(
            message=": mismatched input 'fromm'. Expecting: ",
            error_type=SupersetErrorType.GENERIC_DB_ENGINE_ERROR,
            level=ErrorLevel.ERROR,
            extra={
                "engine_name": "Databricks",
                "issue_codes": [
                    {
                        "code": 1002,
                        "message": "Issue 1002 - The database returned an unexpected error.",
                    }
                ],
            },
        )
    ]