From 60892ae45d3232a5d9c5ff27f376b346ff630198 Mon Sep 17 00:00:00 2001 From: Will Barrett Date: Fri, 6 Dec 2019 14:30:50 -0800 Subject: [PATCH] Re-enable pylint for example-related files (#8771) * re-enable pylint for superset/examples/energy.py * re-enable pylint for superset/examples/world_bank.py * re-enable pylint for superset/examples/tabbed_dashboard.py * Re-enable pylint for superset/examples/helpers.py --- superset/examples/energy.py | 1 - superset/examples/helpers.py | 1 - superset/examples/tabbed_dashboard.py | 3 +-- superset/examples/world_bank.py | 15 ++++++++------- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/superset/examples/energy.py b/superset/examples/energy.py index 359828b44..3d4a269cc 100644 --- a/superset/examples/energy.py +++ b/superset/examples/energy.py @@ -15,7 +15,6 @@ # specific language governing permissions and limitations # under the License. """Loads datasets, dashboards and slices in a new superset instance""" -# pylint: disable=C,R,W import textwrap import pandas as pd diff --git a/superset/examples/helpers.py b/superset/examples/helpers.py index b64300efe..3f1ce6704 100644 --- a/superset/examples/helpers.py +++ b/superset/examples/helpers.py @@ -15,7 +15,6 @@ # specific language governing permissions and limitations # under the License. """Loads datasets, dashboards and slices in a new superset instance""" -# pylint: disable=C,R,W import json import os import zlib diff --git a/superset/examples/tabbed_dashboard.py b/superset/examples/tabbed_dashboard.py index 8b6969489..7fe504cab 100644 --- a/superset/examples/tabbed_dashboard.py +++ b/superset/examples/tabbed_dashboard.py @@ -15,7 +15,6 @@ # specific language governing permissions and limitations # under the License. """Loads datasets, dashboards and slices in a new superset instance""" -# pylint: disable=C,R,W import json import textwrap @@ -24,7 +23,7 @@ from superset import db from .helpers import Dash, Slice, update_slice_ids -def load_tabbed_dashboard(only_metadata=False): +def load_tabbed_dashboard(_=False): """Creating a tabbed dashboard""" print("Creating a dashboard with nested tabs") diff --git a/superset/examples/world_bank.py b/superset/examples/world_bank.py index 2a4b607ca..73ba71286 100644 --- a/superset/examples/world_bank.py +++ b/superset/examples/world_bank.py @@ -15,7 +15,6 @@ # specific language governing permissions and limitations # under the License. """Loads datasets, dashboards and slices in a new superset instance""" -# pylint: disable=C,R,W import json import os import textwrap @@ -42,7 +41,9 @@ from .helpers import ( ) -def load_world_bank_health_n_pop(only_metadata=False, force=False): +def load_world_bank_health_n_pop( + only_metadata=False, force=False +): # pylint: disable=too-many-locals """Loads the world bank health dataset, slices and a dashboard""" tbl_name = "wb_health_population" database = utils.get_example_database() @@ -84,12 +85,12 @@ def load_world_bank_health_n_pop(only_metadata=False, force=False): "sum__SP_DYN_LE00_IN", "sum__SP_RUR_TOTL", ] - for m in metrics: - if not any(col.metric_name == m for col in tbl.metrics): - aggr_func = m[:3] - col = str(column(m[5:]).compile(db.engine)) + for metric in metrics: + if not any(col.metric_name == metric for col in tbl.metrics): + aggr_func = metric[:3] + col = str(column(metric[5:]).compile(db.engine)) tbl.metrics.append( - SqlMetric(metric_name=m, expression=f"{aggr_func}({col})") + SqlMetric(metric_name=metric, expression=f"{aggr_func}({col})") ) db.session.merge(tbl)