chore: set up ruff as a new linter/formatter (#28158)

This commit is contained in:
Maxime Beauchemin
2024-04-24 17:19:53 -07:00
committed by GitHub
parent e8a678b75a
commit 2d63722150
579 changed files with 2508 additions and 2542 deletions

View File

@@ -14,10 +14,10 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import pytest
import pytest # noqa: F401
from superset.extensions import cache_manager
from superset.utils.core import backend, DatasourceType
from superset.utils.core import backend, DatasourceType # noqa: F401
from tests.integration_tests.base_tests import SupersetTestCase
@@ -46,4 +46,4 @@ class UtilsCacheManagerTests(SupersetTestCase):
}
def test_get_explore_form_data_cache_invalid_key(self):
assert cache_manager.explore_form_data_cache.get("foo") == None
assert cache_manager.explore_form_data_cache.get("foo") is None # noqa: E711

View File

@@ -17,7 +17,6 @@
import pytest
from superset.utils.core import form_data_to_adhoc, simple_filter_to_adhoc
from tests.integration_tests.test_app import app
def test_simple_filter_to_adhoc_generates_deterministic_values():

View File

@@ -18,7 +18,7 @@ import io
import pandas as pd
import pyarrow as pa
import pytest
import pytest # noqa: F401
from superset.utils import csv

View File

@@ -40,9 +40,9 @@ class CustomEncFieldAdapter(AbstractEncryptedFieldAdapter):
class EncryptedFieldTest(SupersetTestCase):
def setUp(self) -> None:
self.app.config[
"SQLALCHEMY_ENCRYPTED_FIELD_TYPE_ADAPTER"
] = SQLAlchemyUtilsAdapter
self.app.config["SQLALCHEMY_ENCRYPTED_FIELD_TYPE_ADAPTER"] = (
SQLAlchemyUtilsAdapter
)
encrypted_field_factory.init_app(self.app)
super().setUp()
@@ -53,9 +53,9 @@ class EncryptedFieldTest(SupersetTestCase):
self.assertEqual(self.app.config["SECRET_KEY"], field.key)
def test_custom_adapter(self):
self.app.config[
"SQLALCHEMY_ENCRYPTED_FIELD_TYPE_ADAPTER"
] = CustomEncFieldAdapter
self.app.config["SQLALCHEMY_ENCRYPTED_FIELD_TYPE_ADAPTER"] = (
CustomEncFieldAdapter
)
encrypted_field_factory.init_app(self.app)
field = encrypted_field_factory.create(String(1024))
self.assertTrue(isinstance(field, StringEncryptedType))

View File

@@ -18,7 +18,7 @@ import datetime
import math
from typing import Any
import pytest
import pytest # noqa: F401
from superset.utils.hashing import md5_sha_from_dict, md5_sha_from_str