Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
kgopal492 committed Apr 5, 2024
1 parent 91c3c8e commit e2c82ba
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
8 changes: 5 additions & 3 deletions superset/initialization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,14 +704,16 @@ def index(self) -> FlaskResponse:
return redirect("/superset/welcome/")


class ForceHttps(object):
class ForceHttps: # pylint: disable=too-few-public-methods
"""
wrapper class forces the html schema to be "https"
"""

def __init__(self, app):
def __init__(self, app: Callable[[Dict[str, Any], Callable[..., Any]], Any]):
self.app = app

def __call__(self, environ, start_response):
def __call__(
self, environ: Dict[str, Any], start_response: Callable[..., Any]
) -> Any:
environ["wsgi.url_scheme"] = "https"
return self.app(environ, start_response)
2 changes: 1 addition & 1 deletion superset/key_value/commands/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def validate(self) -> None:
def create(self) -> Key:
try:
value = self.codec.encode(self.value)
except Exception as ex: # pylint: disable=broad-except
except Exception as ex:
raise KeyValueCreateFailedError("Unable to encode value") from ex
entry = KeyValueEntry(
resource=self.resource.value,
Expand Down
2 changes: 1 addition & 1 deletion superset/tasks/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def __init__(self, schedule: str) -> None:
self.schedule = schedule # "hourly" or "daily"

def get_urls(self) -> List[str]:
import json
import json # pylint: disable=import-outside-toplevel

urls = []
session = db.create_scoped_session()
Expand Down
6 changes: 3 additions & 3 deletions superset/tasks/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


@celery_app.task(name="db_tables_cache_warm_up")
def db_tables_cache_warm_up(database_id: str, schema_name: str):
def db_tables_cache_warm_up(database_id: str, schema_name: str) -> None:
"""
Warm up tables in a database schema
Expand Down Expand Up @@ -48,13 +48,13 @@ def db_tables_cache_warm_up(database_id: str, schema_name: str):
cache_timeout=database.table_cache_timeout,
)
logger.info(
"Database tables cache warm up succeeded for database_id: %i, schema_name: %s",
"Database tables cache warm up succeeded for database_id: %i, schema_name: %s", # pylint: disable=line-too-long
database_id,
schema_name,
)
except SupersetException as ex:
logger.exception(
"Superset exception for db_tables_cache_warm_up job database_id: %i, schema_name: %s, message: %s",
"Superset exception for db_tables_cache_warm_up job database_id: %i, schema_name: %s, message: %s", # pylint: disable=line-too-long
database_id,
schema_name,
ex.message,
Expand Down
3 changes: 2 additions & 1 deletion superset/utils/screenshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ def __init__(
# should always capture in standalone
url = modify_url_query(
url,
standalone=DashboardStandaloneMode.HIDE_NAV_AND_TITLE.value, # TODO: temp fix for report mode error
# TODO: temp fix for report mode error
standalone=DashboardStandaloneMode.HIDE_NAV_AND_TITLE.value,
)

super().__init__(url, digest)
Expand Down

0 comments on commit e2c82ba

Please sign in to comment.