Module pachyderm_sdk.errors

Errors that can be raised by this library.

Expand source code
""" Errors that can be raised by this library. """

from typing import Union

from grpc import RpcError
from grpc._channel import _InactiveRpcError


class AuthServiceNotActivated(ConnectionError):
    """If the auth service is not activated but is required."""

    @classmethod
    def try_from(cls, error: RpcError) -> Union["AuthServiceNotActivated", RpcError]:
        if isinstance(error, _InactiveRpcError):
            details = error.details()
            if "the auth service is not activated" in details:
                return cls(details)
        return error


class ConfigError(Exception):
    """Error for issues related to the pachyderm config file."""

    def __init__(self, message):
        super().__init__(message)


class InvalidTransactionOperation(RuntimeError):
    """Error triggered when an invalid operation (i.e. file write)
    is called when inside a transaction.
    """

    def __init__(self):
        super().__init__(
            "File operations are not permitted within a pachyderm transaction."
        )

Classes

class AuthServiceNotActivated (*args, **kwargs)

If the auth service is not activated but is required.

Expand source code
class AuthServiceNotActivated(ConnectionError):
    """If the auth service is not activated but is required."""

    @classmethod
    def try_from(cls, error: RpcError) -> Union["AuthServiceNotActivated", RpcError]:
        if isinstance(error, _InactiveRpcError):
            details = error.details()
            if "the auth service is not activated" in details:
                return cls(details)
        return error

Ancestors

  • builtins.ConnectionError
  • builtins.OSError
  • builtins.Exception
  • builtins.BaseException

Static methods

def try_from(error: grpc.RpcError) ‑> Union[AuthServiceNotActivated, grpc.RpcError]
Expand source code
@classmethod
def try_from(cls, error: RpcError) -> Union["AuthServiceNotActivated", RpcError]:
    if isinstance(error, _InactiveRpcError):
        details = error.details()
        if "the auth service is not activated" in details:
            return cls(details)
    return error
class ConfigError (message)

Error for issues related to the pachyderm config file.

Expand source code
class ConfigError(Exception):
    """Error for issues related to the pachyderm config file."""

    def __init__(self, message):
        super().__init__(message)

Ancestors

  • builtins.Exception
  • builtins.BaseException
class InvalidTransactionOperation

Error triggered when an invalid operation (i.e. file write) is called when inside a transaction.

Expand source code
class InvalidTransactionOperation(RuntimeError):
    """Error triggered when an invalid operation (i.e. file write)
    is called when inside a transaction.
    """

    def __init__(self):
        super().__init__(
            "File operations are not permitted within a pachyderm transaction."
        )

Ancestors

  • builtins.RuntimeError
  • builtins.Exception
  • builtins.BaseException