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

@@ -15,7 +15,8 @@
# specific language governing permissions and limitations
# under the License.
import json
from typing import Any, Dict, Iterator
from collections.abc import Iterator
from typing import Any
from uuid import uuid3
import pytest
@@ -43,7 +44,7 @@ def chart(app_context, load_world_bank_dashboard_with_slices) -> Slice:
@pytest.fixture
def form_data(chart) -> Dict[str, Any]:
def form_data(chart) -> dict[str, Any]:
datasource = f"{chart.datasource.id}__{chart.datasource.type}"
return {
"chart_id": chart.id,
@@ -68,7 +69,7 @@ def permalink_salt() -> Iterator[str]:
def test_post(
form_data: Dict[str, Any], permalink_salt: str, test_client, login_as_admin
form_data: dict[str, Any], permalink_salt: str, test_client, login_as_admin
):
resp = test_client.post(f"api/v1/explore/permalink", json={"formData": form_data})
assert resp.status_code == 201
@@ -125,7 +126,7 @@ def test_post_invalid_schema(test_client, login_as_admin) -> None:
def test_get(
form_data: Dict[str, Any], permalink_salt: str, test_client, login_as_admin
form_data: dict[str, Any], permalink_salt: str, test_client, login_as_admin
) -> None:
resp = test_client.post(f"api/v1/explore/permalink", json={"formData": form_data})
data = json.loads(resp.data.decode("utf-8"))