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,7 @@ from __future__ import annotations
import copy
import json
from typing import Any, Dict, Set
from typing import Any
from alembic import op
from sqlalchemy import and_, Column, Integer, String, Text
@@ -44,8 +44,8 @@ FORM_DATA_BAK_FIELD_NAME = "form_data_bak"
class MigrateViz:
remove_keys: Set[str] = set()
rename_keys: Dict[str, str] = {}
remove_keys: set[str] = set()
rename_keys: dict[str, str] = {}
source_viz_type: str
target_viz_type: str
has_x_axis_control: bool = False
@@ -85,7 +85,7 @@ class MigrateViz:
def _post_action(self) -> None:
"""Some actions after migrate"""
def _migrate_temporal_filter(self, rv_data: Dict[str, Any]) -> None:
def _migrate_temporal_filter(self, rv_data: dict[str, Any]) -> None:
"""Adds a temporal filter."""
granularity_sqla = rv_data.pop("granularity_sqla", None)
time_range = rv_data.pop("time_range", None) or conf.get("DEFAULT_TIME_FILTER")