chore(pre-commit): Add pyupgrade and pycln hooks (#24197)

This commit is contained in:
John Bodley
2023-06-01 12:01:10 -07:00
committed by GitHub
parent 7d7ce63970
commit a4d5d7c6b9
448 changed files with 3084 additions and 3305 deletions

View File

@@ -18,7 +18,8 @@
import json
import logging
from typing import Any, Dict, Iterator, Tuple
from typing import Any
from collections.abc import Iterator
import yaml
@@ -33,7 +34,7 @@ from superset.utils.ssh_tunnel import mask_password_info
logger = logging.getLogger(__name__)
def parse_extra(extra_payload: str) -> Dict[str, Any]:
def parse_extra(extra_payload: str) -> dict[str, Any]:
try:
extra = json.loads(extra_payload)
except json.decoder.JSONDecodeError:
@@ -57,7 +58,7 @@ class ExportDatabasesCommand(ExportModelsCommand):
@staticmethod
def _export(
model: Database, export_related: bool = True
) -> Iterator[Tuple[str, str]]:
) -> Iterator[tuple[str, str]]:
db_file_name = get_filename(model.database_name, model.id, skip_id=True)
file_path = f"databases/{db_file_name}.yaml"