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

@@ -17,7 +17,7 @@
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Dict, Optional, TYPE_CHECKING
from typing import TYPE_CHECKING
from pandas import DataFrame
from sqlalchemy.inspection import inspect
@@ -63,10 +63,10 @@ class PandasDataLoader(DataLoader):
schema=self._detect_schema_name(),
)
def _detect_schema_name(self) -> Optional[str]:
def _detect_schema_name(self) -> str | None:
return inspect(self._db_engine).default_schema_name
def _take_data_types(self, table: Table) -> Optional[Dict[str, str]]:
def _take_data_types(self, table: Table) -> dict[str, str] | None:
if metadata_table := table.table_metadata:
types = metadata_table.types
if types: