This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 601432ad82 fix(pylint): Address errors/warnings introduced by #27867 
(#27889)
601432ad82 is described below

commit 601432ad8255a410c043fee9f51eed03a9ccf03e
Author: John Bodley <[email protected]>
AuthorDate: Wed Apr 3 18:41:21 2024 -0700

    fix(pylint): Address errors/warnings introduced by #27867 (#27889)
---
 superset/common/query_context.py         | 2 +-
 superset/common/query_context_factory.py | 2 +-
 superset/common/query_object.py          | 2 +-
 superset/config.py                       | 2 +-
 superset/daos/base.py                    | 2 +-
 superset/db_engine_specs/postgres.py     | 2 +-
 superset/db_engine_specs/presto.py       | 4 +++-
 superset/models/slice.py                 | 4 ----
 superset/utils/retries.py                | 2 +-
 9 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/superset/common/query_context.py b/superset/common/query_context.py
index 4f517cd905..48b5abfbec 100644
--- a/superset/common/query_context.py
+++ b/superset/common/query_context.py
@@ -61,7 +61,7 @@ class QueryContext:
 
     # TODO: Type datasource and query_object dictionary with TypedDict when it 
becomes
     #  a vanilla python type https://github.com/python/mypy/issues/5288
-    def __init__(
+    def __init__(  # pylint: disable=too-many-arguments
         self,
         *,
         datasource: BaseDatasource,
diff --git a/superset/common/query_context_factory.py 
b/superset/common/query_context_factory.py
index fd18b8f90a..5503f3cb05 100644
--- a/superset/common/query_context_factory.py
+++ b/superset/common/query_context_factory.py
@@ -44,7 +44,7 @@ class QueryContextFactory:  # pylint: 
disable=too-few-public-methods
     def __init__(self) -> None:
         self._query_object_factory = create_query_object_factory()
 
-    def create(
+    def create(  # pylint: disable=too-many-arguments
         self,
         *,
         datasource: DatasourceDict,
diff --git a/superset/common/query_object.py b/superset/common/query_object.py
index 5109c465e0..e4a305316e 100644
--- a/superset/common/query_object.py
+++ b/superset/common/query_object.py
@@ -108,7 +108,7 @@ class QueryObject:  # pylint: 
disable=too-many-instance-attributes
     time_range: str | None
     to_dttm: datetime | None
 
-    def __init__(  # pylint: disable=too-many-locals
+    def __init__(  # pylint: disable=too-many-arguments,too-many-locals
         self,
         *,
         annotation_layers: list[dict[str, Any]] | None = None,
diff --git a/superset/config.py b/superset/config.py
index b6dbfc9fee..19bb7224ae 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -43,7 +43,7 @@ from flask import Blueprint
 from flask_appbuilder.security.manager import AUTH_DB
 from flask_caching.backends.base import BaseCache
 from pandas import Series
-from pandas._libs.parsers import STR_NA_VALUES  # pylint: 
disable=no-name-in-module
+from pandas._libs.parsers import STR_NA_VALUES
 from sqlalchemy.engine.url import URL
 from sqlalchemy.orm.query import Query
 
diff --git a/superset/daos/base.py b/superset/daos/base.py
index ed6471ac81..889a0780f6 100644
--- a/superset/daos/base.py
+++ b/superset/daos/base.py
@@ -49,7 +49,7 @@ class BaseDAO(Generic[T]):
     """
     id_column_name = "id"
 
-    def __init_subclass__(cls) -> None:  # pylint: disable=arguments-differ
+    def __init_subclass__(cls) -> None:
         cls.model_cls = get_args(
             cls.__orig_bases__[0]  # type: ignore  # pylint: disable=no-member
         )[0]
diff --git a/superset/db_engine_specs/postgres.py 
b/superset/db_engine_specs/postgres.py
index b4755c6cd7..ce87aa1f9b 100644
--- a/superset/db_engine_specs/postgres.py
+++ b/superset/db_engine_specs/postgres.py
@@ -209,7 +209,7 @@ class PostgresEngineSpec(BasicParametersMixin, 
PostgresBaseEngineSpec):
     encryption_parameters = {"sslmode": "require"}
 
     max_column_name_length = 63
-    try_remove_schema_from_table_name = False
+    try_remove_schema_from_table_name = False  # pylint: disable=invalid-name
 
     column_type_mappings = (
         (
diff --git a/superset/db_engine_specs/presto.py 
b/superset/db_engine_specs/presto.py
index 0df8d53f4f..3a409e7189 100644
--- a/superset/db_engine_specs/presto.py
+++ b/superset/db_engine_specs/presto.py
@@ -1329,7 +1329,9 @@ class PrestoEngineSpec(PrestoBaseEngineSpec):
                         completed_splits,
                         total_splits,
                     )
-                    if progress > query.progress:
+                    if (  # pylint: disable=consider-using-min-builtin
+                        progress > query.progress
+                    ):
                         query.progress = progress
                     db.session.commit()
             time.sleep(poll_interval)
diff --git a/superset/models/slice.py b/superset/models/slice.py
index 4b1cef7e46..197b09a9e8 100644
--- a/superset/models/slice.py
+++ b/superset/models/slice.py
@@ -172,20 +172,17 @@ class Slice(  # pylint: disable=too-many-public-methods
 
     @renders("datasource_name")
     def datasource_link(self) -> Markup | None:
-        # pylint: disable=no-member
         datasource = self.datasource
         return datasource.link if datasource else None
 
     @renders("datasource_url")
     def datasource_url(self) -> str | None:
-        # pylint: disable=no-member
         if self.table:
             return self.table.explore_url
         datasource = self.datasource
         return datasource.explore_url if datasource else None
 
     def datasource_name_text(self) -> str | None:
-        # pylint: disable=no-member
         if self.table:
             if self.table.schema:
                 return f"{self.table.schema}.{self.table.table_name}"
@@ -198,7 +195,6 @@ class Slice(  # pylint: disable=too-many-public-methods
 
     @property
     def datasource_edit_url(self) -> str | None:
-        # pylint: disable=no-member
         datasource = self.datasource
         return datasource.url if datasource else None
 
diff --git a/superset/utils/retries.py b/superset/utils/retries.py
index 3af821362d..b8db1aa844 100644
--- a/superset/utils/retries.py
+++ b/superset/utils/retries.py
@@ -22,7 +22,7 @@ from typing import Any, Callable, Optional
 import backoff
 
 
-def retry_call(
+def retry_call(  # pylint: disable=too-many-arguments
     func: Callable[..., Any],
     *args: Any,
     strategy: Callable[..., Generator[int, None, None]] = backoff.constant,

Reply via email to