diff --git a/superset/cli/celery.py b/superset/cli/celery.py index a0373573e88..d170d63cfe8 100755 --- a/superset/cli/celery.py +++ b/superset/cli/celery.py @@ -30,7 +30,10 @@ logger = logging.getLogger(__name__) @click.command() @with_appcontext @click.option( - "--workers", "-w", type=int, help="Number of celery server workers to fire up", + "--workers", + "-w", + type=int, + help="Number of celery server workers to fire up", ) def worker(workers: int) -> None: """Starts a Superset worker for async SQL query execution.""" @@ -52,10 +55,16 @@ def worker(workers: int) -> None: @click.command() @with_appcontext @click.option( - "-p", "--port", default="5555", help="Port on which to start the Flower process", + "-p", + "--port", + default="5555", + help="Port on which to start the Flower process", ) @click.option( - "-a", "--address", default="localhost", help="Address on which to run the service", + "-a", + "--address", + default="localhost", + help="Address on which to run the service", ) def flower(port: int, address: str) -> None: """Runs a Celery Flower web server diff --git a/superset/common/query_object_factory.py b/superset/common/query_object_factory.py index 39e58ed2e16..0066346d8a4 100644 --- a/superset/common/query_object_factory.py +++ b/superset/common/query_object_factory.py @@ -122,7 +122,8 @@ class QueryObjectFactory: # pylint: disable=too-few-public-methods # Todo: move it and the view.utils.core to utils package def _determine_time_range_endpoints( - self, raw_endpoints: Optional[Tuple[str, str]] = None, + self, + raw_endpoints: Optional[Tuple[str, str]] = None, ) -> Optional[Tuple[TimeRangeEndpoint, TimeRangeEndpoint]]: if ( self._config["SIP_15_GRACE_PERIOD_END"] diff --git a/superset/tasks/alerts/observer.py b/superset/tasks/alerts/observer.py index cbe73d886ae..fbdf9ff61b7 100644 --- a/superset/tasks/alerts/observer.py +++ b/superset/tasks/alerts/observer.py @@ -49,7 +49,10 @@ def observe(alert_id: int, session: Session) -> Optional[str]: value = float(df.to_records()[0][1]) observation = SQLObservation( - alert_id=alert_id, dttm=datetime.utcnow(), value=value, error_msg=error_msg, + alert_id=alert_id, + dttm=datetime.utcnow(), + value=value, + error_msg=error_msg, ) session.add(observation) diff --git a/superset/tasks/schedules.py b/superset/tasks/schedules.py index 05506d077a9..d9ea43e4ed7 100644 --- a/superset/tasks/schedules.py +++ b/superset/tasks/schedules.py @@ -387,14 +387,18 @@ def _get_slice_screenshot(slice_id: int, session: Session) -> ScreenshotData: chart_url = get_url_path("Superset.slice", slice_id=slice_obj.id, standalone="true") screenshot = ChartScreenshot(chart_url, slice_obj.digest) image_url = _get_url_path( - "Superset.slice", user_friendly=True, slice_id=slice_obj.id, + "Superset.slice", + user_friendly=True, + slice_id=slice_obj.id, ) user = security_manager.get_user_by_username( current_app.config["THUMBNAIL_SELENIUM_USER"], session=session ) image_data = screenshot.compute_and_cache( - user=user, cache=thumbnail_cache, force=True, + user=user, + cache=thumbnail_cache, + force=True, ) session.commit() @@ -542,7 +546,10 @@ def schedule_email_report( bind=True, # TODO: find cause of https://github.com/apache/superset/issues/10530 # and remove retry - autoretry_for=(NoSuchColumnError, ResourceClosedError,), + autoretry_for=( + NoSuchColumnError, + ResourceClosedError, + ), retry_kwargs={"max_retries": 1}, retry_backoff=True, ) @@ -680,7 +687,10 @@ def deliver_slack_alert(alert_content: AlertContent, slack_channel: str) -> None ) deliver_slack_msg( - slack_channel, subject, slack_message, image, + slack_channel, + subject, + slack_message, + image, ) diff --git a/tests/integration_tests/dashboards/security/security_rbac_tests.py b/tests/integration_tests/dashboards/security/security_rbac_tests.py index 61ea6c735bf..467b9d3746c 100644 --- a/tests/integration_tests/dashboards/security/security_rbac_tests.py +++ b/tests/integration_tests/dashboards/security/security_rbac_tests.py @@ -281,7 +281,10 @@ class TestDashboardRoleBasedSecurity(BaseTestDashboardSecurity): # assert self.assert_dashboards_list_view_response( - response, len(published_dashboards), published_dashboards, draft_dashboards, + response, + len(published_dashboards), + published_dashboards, + draft_dashboards, ) # post @@ -341,7 +344,10 @@ class TestDashboardRoleBasedSecurity(BaseTestDashboardSecurity): # assert self.assert_dashboards_list_view_response( - response, len(published_dashboards), published_dashboards, draft_dashboards, + response, + len(published_dashboards), + published_dashboards, + draft_dashboards, ) # post