mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore: updated utils with pylint rules (#11062)
* Updated pylint in cache.py in utils: unecessary bad-whitespace. Autoformatting * Updated pylint in core.py in utils: E0202. * Updated pylint in logging_configurator.py in utils: disable=no-member. Formatting * Updated pylint in machine_auth.py in utils: unused-import * Updated pylint in screenshots.py in utils: unused-import and import-error * Updated pylint in webdriver.py in utils: unused-import
This commit is contained in:
@@ -27,8 +27,7 @@ def view_cache_key(*args: Any, **kwargs: Any) -> str: # pylint: disable=unused-
|
||||
|
||||
|
||||
def memoized_func(
|
||||
key: Callable[..., str] = view_cache_key, # pylint: disable=bad-whitespace
|
||||
attribute_in_key: Optional[str] = None,
|
||||
key: Callable[..., str] = view_cache_key, attribute_in_key: Optional[str] = None,
|
||||
) -> Callable[..., Any]:
|
||||
"""Use this decorator to cache functions that have predefined first arg.
|
||||
|
||||
|
||||
@@ -310,7 +310,6 @@ class DashboardEncoder(json.JSONEncoder):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.sort_keys = True
|
||||
|
||||
# pylint: disable=E0202
|
||||
def default(self, o: Any) -> Dict[Any, Any]:
|
||||
try:
|
||||
vals = {k: v for k, v in o.__dict__.items() if k != "_sa_instance_state"}
|
||||
|
||||
@@ -46,10 +46,8 @@ class DefaultLoggingConfigurator(LoggingConfigurator):
|
||||
superset_logger.setLevel(logging.DEBUG)
|
||||
else:
|
||||
# In production mode, add log handler to sys.stderr.
|
||||
superset_logger.addHandler(
|
||||
logging.StreamHandler()
|
||||
) # pylint: disable=no-member
|
||||
superset_logger.setLevel(logging.INFO) # pylint: disable=no-member
|
||||
superset_logger.addHandler(logging.StreamHandler())
|
||||
superset_logger.setLevel(logging.INFO)
|
||||
|
||||
logging.getLogger("pyhive.presto").setLevel(logging.INFO)
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ from superset.utils.urls import headless_url
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import
|
||||
from flask_appbuilder.security.sqla.models import User
|
||||
|
||||
|
||||
|
||||
@@ -26,12 +26,11 @@ from superset.utils.webdriver import WebDriverProxy, WindowSize
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
try:
|
||||
from PIL import Image # pylint: disable=import-error
|
||||
from PIL import Image
|
||||
except ModuleNotFoundError:
|
||||
logger.info("No PIL installation found")
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import
|
||||
from flask_appbuilder.security.sqla.models import User
|
||||
from flask_caching import Cache
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ SELENIUM_HEADSTART = 3
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import
|
||||
from flask_appbuilder.security.sqla.models import User
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user