From b5c7ed9f18b159330a3bce90d9a7c65609b88d03 Mon Sep 17 00:00:00 2001 From: John Bodley <4567245+john-bodley@users.noreply.github.com> Date: Mon, 16 Aug 2021 09:23:40 -0700 Subject: [PATCH] chore(pylint): Reenable too-many-locals check (#16268) Co-authored-by: John Bodley --- .pylintrc | 1 - superset/common/query_context.py | 2 +- superset/dashboards/api.py | 2 +- superset/dashboards/commands/importers/v1/utils.py | 2 +- superset/datasets/api.py | 2 +- superset/examples/multiformat_time_series.py | 2 +- superset/utils/pandas_postprocessing.py | 2 +- superset/utils/profiler.py | 1 + 8 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.pylintrc b/.pylintrc index 7da2df4de3..87275f000e 100644 --- a/.pylintrc +++ b/.pylintrc @@ -87,7 +87,6 @@ disable= import-outside-toplevel, raise-missing-from, too-few-public-methods, - too-many-locals, duplicate-code, [REPORTS] diff --git a/superset/common/query_context.py b/superset/common/query_context.py index 8735f4836b..32f3c55788 100644 --- a/superset/common/query_context.py +++ b/superset/common/query_context.py @@ -120,7 +120,7 @@ class QueryContext: df.reset_index(level=0, inplace=True) return df - def processing_time_offsets( + def processing_time_offsets( # pylint: disable=too-many-locals self, df: pd.DataFrame, query_object: QueryObject, ) -> CachedTimeOffset: # ensure query_object is immutable diff --git a/superset/dashboards/api.py b/superset/dashboards/api.py index 9cb1a7e387..b0357aa048 100644 --- a/superset/dashboards/api.py +++ b/superset/dashboards/api.py @@ -671,7 +671,7 @@ class DashboardRestApi(BaseSupersetModelRestApi): @event_logger.log_this_with_context( action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.export", log_to_statsd=False, - ) + ) # pylint: disable=too-many-locals def export(self, **kwargs: Any) -> Response: """Export dashboards --- diff --git a/superset/dashboards/commands/importers/v1/utils.py b/superset/dashboards/commands/importers/v1/utils.py index 6eda781517..9a0a6b23eb 100644 --- a/superset/dashboards/commands/importers/v1/utils.py +++ b/superset/dashboards/commands/importers/v1/utils.py @@ -56,7 +56,7 @@ def build_uuid_to_id_map(position: Dict[str, Any]) -> Dict[str, int]: } -def update_id_refs( +def update_id_refs( # pylint: disable=too-many-locals config: Dict[str, Any], chart_ids: Dict[str, int], dataset_info: Dict[str, Dict[str, Any]], diff --git a/superset/datasets/api.py b/superset/datasets/api.py index 35d09448a3..8d8eb6efee 100644 --- a/superset/datasets/api.py +++ b/superset/datasets/api.py @@ -415,7 +415,7 @@ class DatasetRestApi(BaseSupersetModelRestApi): @event_logger.log_this_with_context( action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.export", log_to_statsd=False, - ) + ) # pylint: disable=too-many-locals def export(self, **kwargs: Any) -> Response: """Export datasets --- diff --git a/superset/examples/multiformat_time_series.py b/superset/examples/multiformat_time_series.py index baf7ec8bf3..e473ec8c38 100644 --- a/superset/examples/multiformat_time_series.py +++ b/superset/examples/multiformat_time_series.py @@ -32,7 +32,7 @@ from .helpers import ( ) -def load_multiformat_time_series( +def load_multiformat_time_series( # pylint: disable=too-many-locals only_metadata: bool = False, force: bool = False ) -> None: """Loading time series data from a zip file in the repo""" diff --git a/superset/utils/pandas_postprocessing.py b/superset/utils/pandas_postprocessing.py index 2969beb011..da9163a8ae 100644 --- a/superset/utils/pandas_postprocessing.py +++ b/superset/utils/pandas_postprocessing.py @@ -211,7 +211,7 @@ def _append_columns( @validate_column_args("index", "columns") -def pivot( # pylint: disable=too-many-arguments +def pivot( # pylint: disable=too-many-arguments,too-many-locals df: DataFrame, index: List[str], aggregates: Dict[str, Dict[str, Any]], diff --git a/superset/utils/profiler.py b/superset/utils/profiler.py index f63a195078..e7df50e987 100644 --- a/superset/utils/profiler.py +++ b/superset/utils/profiler.py @@ -21,6 +21,7 @@ from unittest import mock from werkzeug.wrappers import Request, Response try: + # pylint: disable=import-error from pyinstrument import Profiler except ModuleNotFoundError: Profiler = None