mirror of
https://github.com/apache/superset.git
synced 2026-04-09 11:25:23 +00:00
chore(pre-commit): Add pyupgrade and pycln hooks (#24197)
This commit is contained in:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user