chore: enforce more ruff rules (#31447)

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
This commit is contained in:
Maxime Beauchemin
2024-12-18 17:41:34 -08:00
committed by GitHub
parent 9da65d6bfd
commit e51b95ffa8
375 changed files with 1821 additions and 1718 deletions

View File

@@ -1410,7 +1410,7 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
:param old_database_name: the old database name
:param target: The database object
:return: A list of changed view menus (permission resource names)
"""
""" # noqa: E501
view_menu_table = self.viewmenu_model.__table__ # pylint: disable=no-member
new_database_name = target.database_name
old_view_menu_name = self.get_database_perm(target.id, old_database_name)
@@ -1466,7 +1466,7 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
:param old_database_name: the old database name
:param target: The database object
:return: A list of changed view menus (permission resource names)
"""
""" # noqa: E501
from superset.connectors.sqla.models import ( # pylint: disable=import-outside-toplevel
SqlaTable,
)
@@ -2144,7 +2144,7 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
"""
return []
def raise_for_access(
def raise_for_access( # noqa: C901
# pylint: disable=too-many-arguments,too-many-branches,too-many-locals,too-many-statements
self,
dashboard: Optional["Dashboard"] = None,
@@ -2353,7 +2353,7 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
if dashboard:
if self.is_guest_user():
# Guest user is currently used for embedded dashboards only. If the guest
# Guest user is currently used for embedded dashboards only. If the guest # noqa: E501
# user doesn't have access to the dashboard, ignore all other checks.
if self.has_guest_access(dashboard):
return