mirror of
https://github.com/apache/superset.git
synced 2026-04-16 22:55:52 +00:00
chore(pre-commit): Add pyupgrade and pycln hooks (#24197)
This commit is contained in:
@@ -21,7 +21,7 @@ import unittest
|
||||
import copy
|
||||
from datetime import datetime
|
||||
from io import BytesIO
|
||||
from typing import Any, Dict, Optional, List
|
||||
from typing import Any, Optional
|
||||
from unittest import mock
|
||||
from zipfile import ZipFile
|
||||
|
||||
@@ -740,11 +740,11 @@ class TestPostChartDataApi(BaseTestChartDataApi):
|
||||
|
||||
data = rv.json["result"][0]["data"]
|
||||
|
||||
unique_names = set(row["name"] for row in data)
|
||||
unique_names = {row["name"] for row in data}
|
||||
self.maxDiff = None
|
||||
self.assertEqual(len(unique_names), SERIES_LIMIT)
|
||||
self.assertEqual(
|
||||
set(column for column in data[0].keys()), {"state", "name", "sum__num"}
|
||||
{column for column in data[0].keys()}, {"state", "name", "sum__num"}
|
||||
)
|
||||
|
||||
@pytest.mark.usefixtures(
|
||||
@@ -1124,7 +1124,7 @@ class TestGetChartDataApi(BaseTestChartDataApi):
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def physical_query_context(physical_dataset) -> Dict[str, Any]:
|
||||
def physical_query_context(physical_dataset) -> dict[str, Any]:
|
||||
return {
|
||||
"datasource": {
|
||||
"type": physical_dataset.type,
|
||||
@@ -1218,7 +1218,7 @@ def test_data_cache_default_timeout(
|
||||
|
||||
|
||||
def test_chart_cache_timeout(
|
||||
load_energy_table_with_slice: List[Slice],
|
||||
load_energy_table_with_slice: list[Slice],
|
||||
test_client,
|
||||
login_as_admin,
|
||||
physical_query_context,
|
||||
|
||||
Reference in New Issue
Block a user