mirror of https://github.com/apache/superset.git
chore: Mypy fix **kwargs type (#15823)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
This commit is contained in:
parent
3adf8e85cd
commit
671b8f2544
|
@ -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
|
||||
---
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
---
|
||||
|
|
|
@ -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())]
|
||||
|
|
Loading…
Reference in New Issue