chore: Update pylint to 2.17.4 (#24700)

Co-authored-by: John Bodley <john.bodley@gmail.com>
This commit is contained in:
EugeneTorap
2023-07-25 03:13:49 +03:00
committed by GitHub
parent c17accc0b4
commit fc89718d48
99 changed files with 297 additions and 336 deletions

View File

@@ -221,7 +221,7 @@ class DatabaseMixin:
def pre_update(self, database: Database) -> None:
self._pre_add_update(database)
def pre_delete(self, database: Database) -> None: # pylint: disable=no-self-use
def pre_delete(self, database: Database) -> None:
if database.tables:
raise SupersetException(
Markup(
@@ -231,12 +231,12 @@ class DatabaseMixin:
)
)
def check_extra(self, database: Database) -> None: # pylint: disable=no-self-use
def check_extra(self, database: Database) -> None:
# this will check whether json.loads(extra) can succeed
try:
extra = database.get_extra()
except Exception as ex:
raise Exception(
raise Exception( # pylint: disable=broad-exception-raised
_("Extra field cannot be decoded by JSON. %(msg)s", msg=str(ex))
) from ex
@@ -244,7 +244,7 @@ class DatabaseMixin:
metadata_signature = inspect.signature(MetaData)
for key in extra.get("metadata_params", {}):
if key not in metadata_signature.parameters:
raise Exception(
raise Exception( # pylint: disable=broad-exception-raised
_(
"The metadata_params in Extra field "
"is not configured correctly. The key "
@@ -253,13 +253,11 @@ class DatabaseMixin:
)
)
def check_encrypted_extra( # pylint: disable=no-self-use
self, database: Database
) -> None:
def check_encrypted_extra(self, database: Database) -> None:
# this will check whether json.loads(secure_extra) can succeed
try:
database.get_encrypted_extra()
except Exception as ex:
raise Exception(
raise Exception( # pylint: disable=broad-exception-raised
_("Extra field cannot be decoded by JSON. %(msg)s", msg=str(ex))
) from ex

View File

@@ -455,9 +455,10 @@ class ColumnarToDatabaseView(SimpleFormView):
if file_type == {"zip"}:
zipfile_ob = zipfile.ZipFile( # pylint: disable=consider-using-with
form.columnar_file.data[0]
) # pylint: disable=consider-using-with
)
file_type = {filename.split(".")[-1] for filename in zipfile_ob.namelist()}
files = [
# pylint: disable=consider-using-with
io.BytesIO((zipfile_ob.open(filename).read(), filename)[0])
for filename in zipfile_ob.namelist()
]