chore: enforce more ruff rules (#31447)

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
This commit is contained in:
Maxime Beauchemin
2024-12-18 17:41:34 -08:00
committed by GitHub
parent 9da65d6bfd
commit e51b95ffa8
375 changed files with 1821 additions and 1718 deletions

View File

@@ -77,7 +77,7 @@ def test_get_column_spec(
generic_type: GenericDataType,
is_dttm: bool,
) -> None:
from superset.db_engine_specs.mysql import MySQLEngineSpec as spec
from superset.db_engine_specs.mysql import MySQLEngineSpec as spec # noqa: N813
assert_column_spec(spec, native_type, sqla_type, attrs, generic_type, is_dttm)
@@ -98,7 +98,7 @@ def test_convert_dttm(
expected_result: Optional[str],
dttm: datetime, # noqa: F811
) -> None:
from superset.db_engine_specs.mysql import MySQLEngineSpec as spec
from superset.db_engine_specs.mysql import MySQLEngineSpec as spec # noqa: N813
assert_convert_dttm(spec, target_type, expected_result, dttm)
@@ -119,7 +119,7 @@ def test_validate_database_uri(sqlalchemy_uri: str, error: bool) -> None:
url = make_url(sqlalchemy_uri)
if error:
with pytest.raises(ValueError):
with pytest.raises(ValueError): # noqa: PT011
MySQLEngineSpec.validate_database_uri(url)
return
MySQLEngineSpec.validate_database_uri(url)
@@ -255,7 +255,7 @@ def test_column_type_mutator(
description: list[Any],
expected_result: list[tuple[Any, ...]],
):
from superset.db_engine_specs.mysql import MySQLEngineSpec as spec
from superset.db_engine_specs.mysql import MySQLEngineSpec as spec # noqa: N813
mock_cursor = Mock()
mock_cursor.fetchall.return_value = data