From 36bc7b0b8055b7ccdfe06033e418363b41e56c66 Mon Sep 17 00:00:00 2001 From: John Bodley <4567245+john-bodley@users.noreply.github.com> Date: Mon, 16 Aug 2021 10:20:44 -0700 Subject: [PATCH] chore(pylint): Reenable too-few-public-methods check (#16264) Co-authored-by: John Bodley --- .pylintrc | 1 - superset/commands/base.py | 4 ++-- superset/databases/schemas.py | 2 +- superset/extensions.py | 2 +- superset/utils/encrypt.py | 6 ++++-- superset/utils/profiler.py | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.pylintrc b/.pylintrc index bf97ed2c4..e921ee5ac 100644 --- a/.pylintrc +++ b/.pylintrc @@ -85,7 +85,6 @@ disable= missing-docstring, too-many-lines, raise-missing-from, - too-few-public-methods, duplicate-code, [REPORTS] diff --git a/superset/commands/base.py b/superset/commands/base.py index 2db12bb6d..2592a03fa 100644 --- a/superset/commands/base.py +++ b/superset/commands/base.py @@ -43,7 +43,7 @@ class BaseCommand(ABC): """ -class CreateMixin: +class CreateMixin: # pylint: disable=too-few-public-methods @staticmethod def populate_owners( user: User, owner_ids: Optional[List[int]] = None @@ -61,7 +61,7 @@ class CreateMixin: return populate_owners(user, owner_ids, default_to_user=True) -class UpdateMixin: +class UpdateMixin: # pylint: disable=too-few-public-methods @staticmethod def populate_owners( user: User, owner_ids: Optional[List[int]] = None diff --git a/superset/databases/schemas.py b/superset/databases/schemas.py index 303d74057..b0dfc2f9a 100644 --- a/superset/databases/schemas.py +++ b/superset/databases/schemas.py @@ -214,7 +214,7 @@ def extra_validator(value: str) -> str: return value -class DatabaseParametersSchemaMixin: +class DatabaseParametersSchemaMixin: # pylint: disable=too-few-public-methods """ Allow SQLAlchemy URI to be passed as separate parameters. diff --git a/superset/extensions.py b/superset/extensions.py index 619de6a23..dafb4551a 100644 --- a/superset/extensions.py +++ b/superset/extensions.py @@ -98,7 +98,7 @@ class UIManifestProcessor: return self.manifest.get(bundle, {}).get(asset_type, []) -class ProfilingExtension: +class ProfilingExtension: # pylint: disable=too-few-public-methods def __init__(self, interval: float = 1e-4) -> None: self.interval = interval diff --git a/superset/utils/encrypt.py b/superset/utils/encrypt.py index 10bc97d80..240ca5aa8 100644 --- a/superset/utils/encrypt.py +++ b/superset/utils/encrypt.py @@ -22,7 +22,7 @@ from sqlalchemy import TypeDecorator from sqlalchemy_utils import EncryptedType -class AbstractEncryptedFieldAdapter(ABC): +class AbstractEncryptedFieldAdapter(ABC): # pylint: disable=too-few-public-methods @abstractmethod def create( self, @@ -33,7 +33,9 @@ class AbstractEncryptedFieldAdapter(ABC): pass -class SQLAlchemyUtilsAdapter(AbstractEncryptedFieldAdapter): +class SQLAlchemyUtilsAdapter( # pylint: disable=too-few-public-methods + AbstractEncryptedFieldAdapter +): def create( self, app_config: Optional[Dict[str, Any]], diff --git a/superset/utils/profiler.py b/superset/utils/profiler.py index 087ec60ac..269cf5c33 100644 --- a/superset/utils/profiler.py +++ b/superset/utils/profiler.py @@ -27,7 +27,7 @@ except ModuleNotFoundError: Profiler = None -class SupersetProfiler: +class SupersetProfiler: # pylint: disable=too-few-public-methods """ WSGI middleware to instrument Superset.