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

@@ -86,10 +86,13 @@ class TestQueryEstimationCommand(SupersetTestCase):
assert (
ex_info.value.error.error_type == SupersetErrorType.SQLLAB_TIMEOUT_ERROR
)
assert ex_info.value.error.message == __(
"The query estimation was killed after %(sqllab_timeout)s seconds. It might "
"be too complex, or the database might be under heavy load.",
sqllab_timeout=app.config["SQLLAB_QUERY_COST_ESTIMATE_TIMEOUT"],
assert (
ex_info.value.error.message
== __(
"The query estimation was killed after %(sqllab_timeout)s seconds. It might " # noqa: E501
"be too complex, or the database might be under heavy load.",
sqllab_timeout=app.config["SQLLAB_QUERY_COST_ESTIMATE_TIMEOUT"],
)
)
def test_run_success(self) -> None:
@@ -112,7 +115,7 @@ class TestQueryEstimationCommand(SupersetTestCase):
class TestSqlResultExportCommand(SupersetTestCase):
@pytest.fixture()
@pytest.fixture
def create_database_and_query(self):
with self.create_app().app_context():
database = get_example_database()
@@ -246,7 +249,7 @@ class TestSqlResultExportCommand(SupersetTestCase):
class TestSqlExecutionResultsCommand(SupersetTestCase):
@pytest.fixture()
@pytest.fixture
def create_database_and_query(self):
with self.create_app().app_context():
database = get_example_database()
@@ -335,7 +338,7 @@ class TestSqlExecutionResultsCommand(SupersetTestCase):
"superset.views.utils._deserialize_results_payload",
side_effect=SerializationError(),
):
with pytest.raises(SupersetErrorException) as ex_info:
with pytest.raises(SupersetErrorException) as ex_info: # noqa: PT012
command = results.SqlExecutionResultsCommand("test_other", 1000)
command.run()
assert (