mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
chore: Update pylint to 2.17.4 (#24700)
Co-authored-by: John Bodley <john.bodley@gmail.com>
This commit is contained in:
@@ -474,8 +474,8 @@ class DatasetRestApi(BaseSupersetModelRestApi):
|
||||
@event_logger.log_this_with_context(
|
||||
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.export",
|
||||
log_to_statsd=False,
|
||||
) # pylint: disable=too-many-locals
|
||||
def export(self, **kwargs: Any) -> Response:
|
||||
)
|
||||
def export(self, **kwargs: Any) -> Response: # pylint: disable=too-many-locals
|
||||
"""Export datasets
|
||||
---
|
||||
get:
|
||||
|
||||
@@ -106,7 +106,9 @@ def import_metric(session: Session, metric: BaseMetric) -> BaseMetric:
|
||||
if isinstance(metric, SqlMetric):
|
||||
lookup_metric = lookup_sqla_metric
|
||||
else:
|
||||
raise Exception(f"Invalid metric type: {metric}")
|
||||
raise Exception( # pylint: disable=broad-exception-raised
|
||||
f"Invalid metric type: {metric}"
|
||||
)
|
||||
return import_simple_obj(session, metric, lookup_metric)
|
||||
|
||||
|
||||
@@ -125,7 +127,9 @@ def import_column(session: Session, column: BaseColumn) -> BaseColumn:
|
||||
if isinstance(column, TableColumn):
|
||||
lookup_column = lookup_sqla_column
|
||||
else:
|
||||
raise Exception(f"Invalid column type: {column}")
|
||||
raise Exception( # pylint: disable=broad-exception-raised
|
||||
f"Invalid column type: {column}"
|
||||
)
|
||||
return import_simple_obj(session, column, lookup_column)
|
||||
|
||||
|
||||
|
||||
@@ -66,7 +66,9 @@ def get_sqla_type(native_type: str) -> VisitableType:
|
||||
size = int(match.group(1))
|
||||
return String(size)
|
||||
|
||||
raise Exception(f"Unknown type: {native_type}")
|
||||
raise Exception( # pylint: disable=broad-exception-raised
|
||||
f"Unknown type: {native_type}"
|
||||
)
|
||||
|
||||
|
||||
def get_dtype(df: pd.DataFrame, dataset: SqlaTable) -> dict[str, VisitableType]:
|
||||
|
||||
@@ -149,7 +149,7 @@ class DatasetRelatedObjectsResponse(Schema):
|
||||
|
||||
|
||||
class ImportV1ColumnSchema(Schema):
|
||||
# pylint: disable=no-self-use, unused-argument
|
||||
# pylint: disable=unused-argument
|
||||
@pre_load
|
||||
def fix_extra(self, data: dict[str, Any], **kwargs: Any) -> dict[str, Any]:
|
||||
"""
|
||||
@@ -175,7 +175,7 @@ class ImportV1ColumnSchema(Schema):
|
||||
|
||||
|
||||
class ImportV1MetricSchema(Schema):
|
||||
# pylint: disable=no-self-use, unused-argument
|
||||
# pylint: disable=unused-argument
|
||||
@pre_load
|
||||
def fix_extra(self, data: dict[str, Any], **kwargs: Any) -> dict[str, Any]:
|
||||
"""
|
||||
@@ -198,7 +198,7 @@ class ImportV1MetricSchema(Schema):
|
||||
|
||||
|
||||
class ImportV1DatasetSchema(Schema):
|
||||
# pylint: disable=no-self-use, unused-argument
|
||||
# pylint: disable=unused-argument
|
||||
@pre_load
|
||||
def fix_extra(self, data: dict[str, Any], **kwargs: Any) -> dict[str, Any]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user