Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Apr 3, 2024
1 parent bf5d4e9 commit 2052536
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion superset/common/query_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion superset/common/query_context_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion superset/common/query_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -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-locals, too-many-arguments
self,
*,
annotation_layers: list[dict[str, Any]] | None = None,
Expand Down
2 changes: 1 addition & 1 deletion superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
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

Expand Down
2 changes: 1 addition & 1 deletion superset/daos/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion superset/db_engine_specs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ Alternatively, it's also possible to impersonate users by implementing the `upda

Support for authenticating to a database using personal OAuth2 access tokens was introduced in [SIP-85](https://github.com/apache/superset/issues/20300). The Google Sheets DB engine spec is the reference implementation.

To add support for OAuth2 to a DB engine spec, the following attributes are needed:
Note that this API is still experimental and evolving quickly, subject to breaking changes. Currently, to add support for OAuth2 to a DB engine spec, the following attributes are needed:

```python
class BaseEngineSpec:
Expand Down
2 changes: 1 addition & 1 deletion superset/db_engine_specs/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
(
Expand Down
3 changes: 1 addition & 2 deletions superset/db_engine_specs/presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@ def handle_cursor(cls, cursor: Cursor, query: Query) -> None:
completed_splits,
total_splits,
)
if progress > query.progress:
query.progress = progress
query.progress = max(query.progress, progress)
db.session.commit()
time.sleep(poll_interval)
logger.info("Query %i: Polling the cursor for progress", query_id)
Expand Down
4 changes: 0 additions & 4 deletions superset/models/slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,20 +172,17 @@ def get_datasource(self) -> SqlaTable | None:

@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}"
Expand All @@ -198,7 +195,6 @@ def datasource_name_text(self) -> str | None:

@property
def datasource_edit_url(self) -> str | None:
# pylint: disable=no-member
datasource = self.datasource
return datasource.url if datasource else None

Expand Down
2 changes: 1 addition & 1 deletion superset/utils/retries.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
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,
Expand Down

0 comments on commit 2052536

Please sign in to comment.