mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore(pre-commit): Add pyupgrade and pycln hooks (#24197)
This commit is contained in:
@@ -15,8 +15,8 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from collections.abc import Iterator
|
||||
from datetime import datetime, timezone
|
||||
from typing import Iterator, List, Tuple, Type
|
||||
|
||||
import yaml
|
||||
from flask_appbuilder import Model
|
||||
@@ -30,21 +30,21 @@ METADATA_FILE_NAME = "metadata.yaml"
|
||||
|
||||
|
||||
class ExportModelsCommand(BaseCommand):
|
||||
dao: Type[BaseDAO] = BaseDAO
|
||||
not_found: Type[CommandException] = CommandException
|
||||
dao: type[BaseDAO] = BaseDAO
|
||||
not_found: type[CommandException] = CommandException
|
||||
|
||||
def __init__(self, model_ids: List[int], export_related: bool = True):
|
||||
def __init__(self, model_ids: list[int], export_related: bool = True):
|
||||
self.model_ids = model_ids
|
||||
self.export_related = export_related
|
||||
|
||||
# this will be set when calling validate()
|
||||
self._models: List[Model] = []
|
||||
self._models: list[Model] = []
|
||||
|
||||
@staticmethod
|
||||
def _export(model: Model, export_related: bool = True) -> Iterator[Tuple[str, str]]:
|
||||
def _export(model: Model, export_related: bool = True) -> Iterator[tuple[str, str]]:
|
||||
raise NotImplementedError("Subclasses MUST implement _export")
|
||||
|
||||
def run(self) -> Iterator[Tuple[str, str]]:
|
||||
def run(self) -> Iterator[tuple[str, str]]:
|
||||
self.validate()
|
||||
|
||||
metadata = {
|
||||
|
||||
Reference in New Issue
Block a user