mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore: Update pylint to 2.17.4 (#24700)
Co-authored-by: John Bodley <john.bodley@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user