diff --git a/superset/annotation_layers/annotations/api.py b/superset/annotation_layers/annotations/api.py index 17c4ee5f64..2e2f81fe27 100644 --- a/superset/annotation_layers/annotations/api.py +++ b/superset/annotation_layers/annotations/api.py @@ -137,7 +137,7 @@ class AnnotationRestApi(BaseSupersetModelRestApi): @permission_name("get") @rison(get_list_schema) def get_list( # pylint: disable=arguments-differ - self, pk: int, **kwargs: Dict[str, Any] + self, pk: int, **kwargs: Any ) -> Response: """Get a list of annotations --- @@ -198,7 +198,7 @@ class AnnotationRestApi(BaseSupersetModelRestApi): @permission_name("get") @rison(get_item_schema) def get( # pylint: disable=arguments-differ - self, pk: int, annotation_id: int, **kwargs: Dict[str, Any] + self, pk: int, annotation_id: int, **kwargs: Any ) -> Response: """Get item from Model --- diff --git a/superset/charts/api.py b/superset/charts/api.py index 3b3227afe5..135b1d6425 100644 --- a/superset/charts/api.py +++ b/superset/charts/api.py @@ -814,7 +814,7 @@ class ChartRestApi(BaseSupersetModelRestApi): f".cache_screenshot", log_to_statsd=False, ) - def cache_screenshot(self, pk: int, **kwargs: Dict[str, bool]) -> WerkzeugResponse: + def cache_screenshot(self, pk: int, **kwargs: Any) -> WerkzeugResponse: """ --- get: @@ -946,9 +946,7 @@ class ChartRestApi(BaseSupersetModelRestApi): action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.thumbnail", log_to_statsd=False, ) - def thumbnail( - self, pk: int, digest: str, **kwargs: Dict[str, bool] - ) -> WerkzeugResponse: + def thumbnail(self, pk: int, digest: str, **kwargs: Any) -> WerkzeugResponse: """Get Chart thumbnail --- get: diff --git a/superset/dashboards/api.py b/superset/dashboards/api.py index a581a2d5c9..cd74c9db68 100644 --- a/superset/dashboards/api.py +++ b/superset/dashboards/api.py @@ -18,7 +18,7 @@ import json import logging from datetime import datetime from io import BytesIO -from typing import Any, Dict, Optional +from typing import Any, Optional from zipfile import is_zipfile, ZipFile from flask import g, make_response, redirect, request, Response, send_file, url_for @@ -755,9 +755,7 @@ class DashboardRestApi(BaseSupersetModelRestApi): action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.thumbnail", log_to_statsd=False, ) - def thumbnail( - self, pk: int, digest: str, **kwargs: Dict[str, bool] - ) -> WerkzeugResponse: + def thumbnail(self, pk: int, digest: str, **kwargs: Any) -> WerkzeugResponse: """Get Dashboard thumbnail --- get: diff --git a/superset/reports/logs/api.py b/superset/reports/logs/api.py index e71376f14b..6b11da556f 100644 --- a/superset/reports/logs/api.py +++ b/superset/reports/logs/api.py @@ -97,7 +97,7 @@ class ReportExecutionLogRestApi(BaseSupersetModelRestApi): @permission_name("get") @rison(get_list_schema) def get_list( # pylint: disable=arguments-differ - self, pk: int, **kwargs: Dict[str, Any] + self, pk: int, **kwargs: Any ) -> Response: """Get a list of report schedule logs --- @@ -158,7 +158,7 @@ class ReportExecutionLogRestApi(BaseSupersetModelRestApi): @permission_name("get") @rison(get_item_schema) def get( # pylint: disable=arguments-differ - self, pk: int, log_id: int, **kwargs: Dict[str, Any] + self, pk: int, log_id: int, **kwargs: Any ) -> Response: """Get a report schedule log --- diff --git a/superset/utils/decorators.py b/superset/utils/decorators.py index 968914586d..3728e3a9dc 100644 --- a/superset/utils/decorators.py +++ b/superset/utils/decorators.py @@ -44,7 +44,7 @@ def stats_timing(stats_key: str, stats_logger: BaseStatsLogger) -> Iterator[floa stats_logger.timing(stats_key, now_as_float() - start_ts) -def arghash(args: Any, kwargs: Dict[str, Any]) -> int: +def arghash(args: Any, kwargs: Any) -> int: """Simple argument hash with kwargs sorted.""" sorted_args = tuple( x if hasattr(x, "__repr__") else x for x in [*args, *sorted(kwargs.items())]