mirror of
https://github.com/apache/superset.git
synced 2026-04-25 11:04:48 +00:00
chore(pre-commit): Add pyupgrade and pycln hooks (#24197)
This commit is contained in:
@@ -20,7 +20,7 @@ import copy
|
||||
import json
|
||||
import re
|
||||
import uuid
|
||||
from typing import Any, Dict
|
||||
from typing import Any
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
@@ -296,7 +296,7 @@ def test_import_column_extra_is_string(mocker: MockFixture, session: Session) ->
|
||||
session.flush()
|
||||
|
||||
dataset_uuid = uuid.uuid4()
|
||||
yaml_config: Dict[str, Any] = {
|
||||
yaml_config: dict[str, Any] = {
|
||||
"version": "1.0.0",
|
||||
"table_name": "my_table",
|
||||
"main_dttm_col": "ds",
|
||||
@@ -388,7 +388,7 @@ def test_import_column_allowed_data_url(
|
||||
session.flush()
|
||||
|
||||
dataset_uuid = uuid.uuid4()
|
||||
yaml_config: Dict[str, Any] = {
|
||||
yaml_config: dict[str, Any] = {
|
||||
"version": "1.0.0",
|
||||
"table_name": "my_table",
|
||||
"main_dttm_col": "ds",
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
from typing import Any, Dict, TYPE_CHECKING
|
||||
from typing import Any, TYPE_CHECKING
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -23,7 +23,7 @@ if TYPE_CHECKING:
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def columns_default() -> Dict[str, Any]:
|
||||
def columns_default() -> dict[str, Any]:
|
||||
"""Default props for new columns"""
|
||||
return {
|
||||
"changed_by": 1,
|
||||
@@ -49,7 +49,7 @@ def columns_default() -> Dict[str, Any]:
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def sample_columns() -> Dict["TableColumn", Dict[str, Any]]:
|
||||
def sample_columns() -> dict["TableColumn", dict[str, Any]]:
|
||||
from superset.connectors.sqla.models import TableColumn
|
||||
|
||||
return {
|
||||
@@ -93,7 +93,7 @@ def sample_columns() -> Dict["TableColumn", Dict[str, Any]]:
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def sample_metrics() -> Dict["SqlMetric", Dict[str, Any]]:
|
||||
def sample_metrics() -> dict["SqlMetric", dict[str, Any]]:
|
||||
from superset.connectors.sqla.models import SqlMetric
|
||||
|
||||
return {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from typing import Iterator
|
||||
from collections.abc import Iterator
|
||||
|
||||
import pytest
|
||||
from sqlalchemy.orm.session import Session
|
||||
|
||||
Reference in New Issue
Block a user