From cb78136f411062a2e0a9ff5fddaf092ee3ef958e Mon Sep 17 00:00:00 2001 From: "alexey.shtyrnyaev" Date: Tue, 13 Dec 2022 17:49:47 +0300 Subject: [PATCH] add raise NotImplementedError in abstractmethod --- trino/auth.py | 6 +++--- trino/client.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/trino/auth.py b/trino/auth.py index dc7b577a..99aff999 100644 --- a/trino/auth.py +++ b/trino/auth.py @@ -33,7 +33,7 @@ class Authentication(metaclass=abc.ABCMeta): @abc.abstractmethod def set_http_session(self, http_session: Session) -> Session: - pass + raise NotImplementedError def get_exceptions(self) -> Tuple[Any, ...]: return tuple() @@ -209,11 +209,11 @@ class _OAuth2TokenCache(metaclass=abc.ABCMeta): @abc.abstractmethod def get_token_from_cache(self, host: Optional[str]) -> Optional[str]: - pass + raise NotImplementedError @abc.abstractmethod def store_token_to_cache(self, host: Optional[str], token: str) -> None: - pass + raise NotImplementedError class _OAuth2TokenInMemoryCache(_OAuth2TokenCache): diff --git a/trino/client.py b/trino/client.py index f74539b0..6a309adf 100644 --- a/trino/client.py +++ b/trino/client.py @@ -850,7 +850,7 @@ def decorated(*args, **kwargs): class ValueMapper(abc.ABC, Generic[T]): @abc.abstractmethod def map(self, value: Any) -> Optional[T]: - pass + raise NotImplementedError class NoOpValueMapper(ValueMapper[Any]): @@ -900,11 +900,11 @@ def __init__(self, whole_python_temporal_value: PythonTemporalType, remaining_fr @abc.abstractmethod def new_instance(self, value: PythonTemporalType, fraction: Decimal) -> TemporalType[PythonTemporalType]: - pass + raise NotImplementedError @abc.abstractmethod def to_python_type(self) -> PythonTemporalType: - pass + raise NotImplementedError def round_to(self, precision: int) -> TemporalType: """ @@ -930,7 +930,7 @@ def add_time_delta(self, time_delta: timedelta) -> PythonTemporalType: """ This method shall be overriden to implement fraction arithmetics. """ - pass + raise NotImplementedError def normalize(self, value: PythonTemporalType) -> PythonTemporalType: """