fix(pylint): Address errors/warnings introduced by #27867 (#27889)

This commit is contained in:
John Bodley 2024-04-03 18:41:21 -07:00 committed by GitHub
parent a9681fa3f3
commit 601432ad82
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 10 additions and 12 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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

View File

@ -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]

View File

@ -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 = (
(

View File

@ -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)

View File

@ -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

View File

@ -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,