Skip to content

exceptions

openml.exceptions #

ObjectNotPublishedError #

ObjectNotPublishedError(message: str)

Bases: PyOpenMLError

Indicates an object has not been published yet.

Source code in openml/exceptions.py
def __init__(self, message: str):
    self.message = message
    super().__init__(message)

OpenMLAuthenticationError #

OpenMLAuthenticationError(message: str)

Bases: OpenMLServerError

Exception raised when API authentication fails.

This typically occurs when: - No API key is configured - The API key is invalid or expired - The API key format is incorrect

This is different from authorization (OpenMLNotAuthorizedError), which occurs when a valid API key lacks permissions for the requested operation.

Source code in openml/exceptions.py
def __init__(self, message: str):
    help_text = (
        "\n\nTo fix this:\n"
        "1. Get your API key from https://www.openml.org/\n"
        "   (you'll need to register for a free account if you don't have one)\n"
        "2. Configure your API key by following the authentication guide:\n"
        "   https://openml.github.io/openml-python/latest/examples/Basics/introduction_tutorial/#authentication"
    )
    super().__init__(message + help_text)

OpenMLCacheException #

OpenMLCacheException(message: str)

Bases: PyOpenMLError

Dataset / task etc not found in cache

Source code in openml/exceptions.py
def __init__(self, message: str):
    self.message = message
    super().__init__(message)

OpenMLHashException #

OpenMLHashException(message: str)

Bases: PyOpenMLError

Locally computed hash is different than hash announced by the server.

Source code in openml/exceptions.py
def __init__(self, message: str):
    self.message = message
    super().__init__(message)

OpenMLNotAuthorizedError #

OpenMLNotAuthorizedError(message: str)

Bases: OpenMLServerError

Indicates an authenticated user is not authorized to execute the requested action.

Source code in openml/exceptions.py
def __init__(self, message: str):
    self.message = message
    super().__init__(message)

OpenMLPrivateDatasetError #

OpenMLPrivateDatasetError(message: str)

Bases: PyOpenMLError

Exception thrown when the user has no rights to access the dataset.

Source code in openml/exceptions.py
def __init__(self, message: str):
    self.message = message
    super().__init__(message)

OpenMLRunsExistError #

OpenMLRunsExistError(run_ids: set[int], message: str)

Bases: PyOpenMLError

Indicates run(s) already exists on the server when they should not be duplicated.

Source code in openml/exceptions.py
def __init__(self, run_ids: set[int], message: str) -> None:
    if len(run_ids) < 1:
        raise ValueError("Set of run ids must be non-empty.")
    self.run_ids = run_ids
    super().__init__(message)

OpenMLServerError #

OpenMLServerError(message: str)

Bases: PyOpenMLError

class for when something is really wrong on the server (result did not parse to dict), contains unparsed error.

Source code in openml/exceptions.py
def __init__(self, message: str):
    self.message = message
    super().__init__(message)

OpenMLServerException #

OpenMLServerException(message: str, code: int | None = None, url: str | None = None)

Bases: OpenMLServerError

exception for when the result of the server was not 200 (e.g., listing call w/o results).

Source code in openml/exceptions.py
def __init__(self, message: str, code: int | None = None, url: str | None = None):
    self.message = message
    self.code = code
    self.url = url
    super().__init__(message)

OpenMLServerNoResult #

OpenMLServerNoResult(message: str, code: int | None = None, url: str | None = None)

Bases: OpenMLServerException

Exception for when the result of the server is empty.

Source code in openml/exceptions.py
def __init__(self, message: str, code: int | None = None, url: str | None = None):
    self.message = message
    self.code = code
    self.url = url
    super().__init__(message)

PyOpenMLError #

PyOpenMLError(message: str)

Bases: Exception

Base class for all exceptions in OpenML-Python.

Source code in openml/exceptions.py
def __init__(self, message: str):
    self.message = message
    super().__init__(message)