From 9c2b27f37a08dfd38ed0c2fd3959463da0f1d2b0 Mon Sep 17 00:00:00 2001 From: Will Barrett Date: Sat, 7 Dec 2019 17:52:08 -0800 Subject: [PATCH] Re-enable Pylint on some celery-related files (#8765) * Re-enable pylint for superset/tasks/schedules.py * re-enable pylint for superset/tasks/celery_app.py --- superset/tasks/celery_app.py | 2 +- superset/tasks/schedules.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/superset/tasks/celery_app.py b/superset/tasks/celery_app.py index 3724ec72da..0f3cd0ef55 100644 --- a/superset/tasks/celery_app.py +++ b/superset/tasks/celery_app.py @@ -14,7 +14,6 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -# pylint: disable=C,R,W """ This is the main entrypoint used by Celery workers. As such, @@ -29,6 +28,7 @@ from superset.extensions import celery_app create_app() # Need to import late, as the celery_app will have been setup by "create_app()" +# pylint: disable=wrong-import-position, unused-import from . import cache, schedules # isort:skip # Export the celery app globally for Celery (as run on the cmd line) to find diff --git a/superset/tasks/schedules.py b/superset/tasks/schedules.py index 9ae67f5eaf..59696effde 100644 --- a/superset/tasks/schedules.py +++ b/superset/tasks/schedules.py @@ -14,7 +14,6 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -# pylint: disable=C,R,W """Utility functions used across Superset""" @@ -24,7 +23,7 @@ import urllib.request from collections import namedtuple from datetime import datetime, timedelta from email.utils import make_msgid, parseaddr -from urllib.error import URLError +from urllib.error import URLError # pylint: disable=ungrouped-imports import croniter import simplejson as json @@ -190,11 +189,11 @@ def destroy_webdriver(driver): # and catch-all exceptions try: retry_call(driver.close, tries=2) - except Exception: + except Exception: # pylint: disable=broad-except pass try: driver.quit() - except Exception: + except Exception: # pylint: disable=broad-except pass @@ -348,7 +347,9 @@ def deliver_slice(schedule): @celery_app.task(name="email_reports.send", bind=True, soft_time_limit=300) -def schedule_email_report(task, report_type, schedule_id, recipients=None): +def schedule_email_report( + task, report_type, schedule_id, recipients=None +): # pylint: disable=unused-argument model_cls = get_scheduler_model(report_type) schedule = db.create_scoped_session().query(model_cls).get(schedule_id)