Skip to content

Commit

Permalink
Removed disabled linting redefined-outer-name. Url parameters are ren…
Browse files Browse the repository at this point in the history
…amed where url was already defined in class attributes (apache#10911)
  • Loading branch information
kkucharc authored and auxten committed Nov 20, 2020
1 parent 926c37a commit 3adec64
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions superset/models/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,8 @@ def get_password_masked_url_from_uri( # pylint: disable=invalid-name
return cls.get_password_masked_url(sqlalchemy_url)

@classmethod
def get_password_masked_url(
cls, url: URL # pylint: disable=redefined-outer-name
) -> URL:
url_copy = deepcopy(url)
def get_password_masked_url(cls, masked_url: URL) -> URL:
url_copy = deepcopy(masked_url)
if url_copy.password is not None:
url_copy.password = PASSWORD_MASK
return url_copy
Expand All @@ -279,19 +277,17 @@ def set_sqlalchemy_uri(self, uri: str) -> None:
self.sqlalchemy_uri = str(conn) # hides the password

def get_effective_user(
self,
url: URL, # pylint: disable=redefined-outer-name
user_name: Optional[str] = None,
self, object_url: URL, user_name: Optional[str] = None,
) -> Optional[str]:
"""
Get the effective user, especially during impersonation.
:param url: SQL Alchemy URL object
:param object_url: SQL Alchemy URL object
:param user_name: Default username
:return: The effective username
"""
effective_username = None
if self.impersonate_user:
effective_username = url.username
effective_username = object_url.username
if user_name:
effective_username = user_name
elif (
Expand Down

0 comments on commit 3adec64

Please sign in to comment.