chore(tests): Spelling (#25454)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-authored-by: Evan Rusackas <evan@preset.io> Co-authored-by: John Bodley <4567245+john-bodley@users.noreply.github.com>
This commit is contained in:
parent
175ba78d32
commit
1818054166
|
|
@ -79,7 +79,7 @@ def create_user(app_context: AppContext):
|
|||
username,
|
||||
"firstname",
|
||||
"lastname",
|
||||
"email@exaple.com",
|
||||
"email@example.com",
|
||||
security_manager.find_role(role),
|
||||
password,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2185,17 +2185,17 @@ class TestDatabaseApi(SupersetTestCase):
|
|||
"""
|
||||
Database API: Test test connection failed due to invalid hostname
|
||||
"""
|
||||
msg = 'psql: error: could not translate host name "locahost" to address: nodename nor servname provided, or not known'
|
||||
msg = 'psql: error: could not translate host name "localhost_" to address: nodename nor servname provided, or not known'
|
||||
mock_build_db.return_value.set_sqlalchemy_uri.side_effect = DBAPIError(
|
||||
msg, None, None
|
||||
)
|
||||
mock_build_db.return_value.db_engine_spec.__name__ = "Some name"
|
||||
superset_error = SupersetError(
|
||||
message='Unable to resolve hostname "locahost".',
|
||||
message='Unable to resolve hostname "localhost_".',
|
||||
error_type="CONNECTION_INVALID_HOSTNAME_ERROR",
|
||||
level="error",
|
||||
extra={
|
||||
"hostname": "locahost",
|
||||
"hostname": "localhost_",
|
||||
"issue_codes": [
|
||||
{
|
||||
"code": 1007,
|
||||
|
|
@ -2212,7 +2212,7 @@ class TestDatabaseApi(SupersetTestCase):
|
|||
|
||||
self.login(ADMIN_USERNAME)
|
||||
data = {
|
||||
"sqlalchemy_uri": "postgres://username:password@locahost:12345/db",
|
||||
"sqlalchemy_uri": "postgres://username:password@localhost_:12345/db",
|
||||
"database_name": "examples",
|
||||
"impersonate_user": False,
|
||||
"server_cert": None,
|
||||
|
|
@ -3840,7 +3840,7 @@ class TestDatabaseApi(SupersetTestCase):
|
|||
Database API: validate SQL with errors
|
||||
"""
|
||||
request_payload = {
|
||||
"sql": "SELECT col1 froma table1",
|
||||
"sql": "SELECT col1 from_ table1",
|
||||
"schema": None,
|
||||
"template_params": None,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -336,11 +336,11 @@ class TestBigQueryDbEngineSpec(TestDbEngineSpec):
|
|||
)
|
||||
]
|
||||
|
||||
msg = 'Syntax error: Expected end of input but got identifier "fromm"'
|
||||
msg = 'Syntax error: Expected end of input but got identifier "from_"'
|
||||
result = BigQueryEngineSpec.extract_errors(Exception(msg))
|
||||
assert result == [
|
||||
SupersetError(
|
||||
message='Please check your query for syntax errors at or near "fromm". Then, try running your query again.',
|
||||
message='Please check your query for syntax errors at or near "from_". Then, try running your query again.',
|
||||
error_type=SupersetErrorType.SYNTAX_ERROR,
|
||||
level=ErrorLevel.ERROR,
|
||||
extra={
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ class TestGsheetsDbEngineSpec(TestDbEngineSpec):
|
|||
"""
|
||||
Test that custom error messages are extracted correctly.
|
||||
"""
|
||||
msg = 'SQLError: near "fromm": syntax error'
|
||||
msg = 'SQLError: near "from_": syntax error'
|
||||
result = GSheetsEngineSpec.extract_errors(Exception(msg))
|
||||
assert result == [
|
||||
SupersetError(
|
||||
message='Please check your query for syntax errors near "fromm". Then, try running your query again.',
|
||||
message='Please check your query for syntax errors near "from_". Then, try running your query again.',
|
||||
error_type=SupersetErrorType.SYNTAX_ERROR,
|
||||
level=ErrorLevel.ERROR,
|
||||
extra={
|
||||
|
|
|
|||
|
|
@ -177,11 +177,11 @@ class TestMySQLEngineSpecsDbEngineSpec(TestDbEngineSpec):
|
|||
)
|
||||
]
|
||||
|
||||
msg = "check the manual that corresponds to your MySQL server version for the right syntax to use near 'fromm"
|
||||
msg = "check the manual that corresponds to your MySQL server version for the right syntax to use near 'from_"
|
||||
result = MySQLEngineSpec.extract_errors(Exception(msg))
|
||||
assert result == [
|
||||
SupersetError(
|
||||
message='Please check your query for syntax errors near "fromm". Then, try running your query again.',
|
||||
message='Please check your query for syntax errors near "from_". Then, try running your query again.',
|
||||
error_type=SupersetErrorType.SYNTAX_ERROR,
|
||||
level=ErrorLevel.ERROR,
|
||||
extra={
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class TestPostgresDbEngineSpec(TestDbEngineSpec):
|
|||
"(timestamp 'epoch' + lower_case * interval '1 second'))",
|
||||
)
|
||||
|
||||
def test_time_exp_mixd_case_col_1y(self):
|
||||
def test_time_exp_mixed_case_col_1y(self):
|
||||
"""
|
||||
DB Eng Specs (postgres): Test grain expr mixed case 1 YEAR
|
||||
"""
|
||||
|
|
@ -241,14 +241,14 @@ class TestPostgresDbEngineSpec(TestDbEngineSpec):
|
|||
]
|
||||
|
||||
msg = (
|
||||
'psql: error: could not translate host name "locahost" to address: '
|
||||
'psql: error: could not translate host name "localhost_" to address: '
|
||||
"nodename nor servname provided, or not known"
|
||||
)
|
||||
result = PostgresEngineSpec.extract_errors(Exception(msg))
|
||||
assert result == [
|
||||
SupersetError(
|
||||
error_type=SupersetErrorType.CONNECTION_INVALID_HOSTNAME_ERROR,
|
||||
message='The hostname "locahost" cannot be resolved.',
|
||||
message='The hostname "localhost_" cannot be resolved.',
|
||||
level=ErrorLevel.ERROR,
|
||||
extra={
|
||||
"engine_name": "PostgreSQL",
|
||||
|
|
@ -421,11 +421,11 @@ psql: error: could not connect to server: Operation timed out
|
|||
)
|
||||
]
|
||||
|
||||
msg = 'syntax error at or near "fromm"'
|
||||
msg = 'syntax error at or near "from_"'
|
||||
result = PostgresEngineSpec.extract_errors(Exception(msg))
|
||||
assert result == [
|
||||
SupersetError(
|
||||
message='Please check your query for syntax errors at or near "fromm". Then, try running your query again.',
|
||||
message='Please check your query for syntax errors at or near "from_". Then, try running your query again.',
|
||||
error_type=SupersetErrorType.SYNTAX_ERROR,
|
||||
level=ErrorLevel.ERROR,
|
||||
extra={
|
||||
|
|
|
|||
|
|
@ -968,7 +968,7 @@ class TestPrestoDbEngineSpec(TestDbEngineSpec):
|
|||
result = PrestoEngineSpec._extract_error_message(exception)
|
||||
assert result == "name at location: msg"
|
||||
|
||||
def test_extract_error_message_db_errr(self):
|
||||
def test_extract_error_message_db_error(self):
|
||||
from pyhive.exc import DatabaseError
|
||||
|
||||
exception = DatabaseError({"message": "Err message"})
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class TestEventLogger(unittest.TestCase):
|
|||
# class is instantiated and returned
|
||||
self.assertIsInstance(res, DBEventLogger)
|
||||
|
||||
def test_raises_typerror_if_not_abc(self):
|
||||
def test_raises_typeerror_if_not_abc(self):
|
||||
# test that assignment of non AbstractEventLogger derived type raises
|
||||
# TypeError
|
||||
with self.assertRaises(TypeError):
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class TestSqlLabApi(SupersetTestCase):
|
|||
{"SQLLAB_BACKEND_PERSISTENCE": False},
|
||||
clear=True,
|
||||
)
|
||||
def test_get_from_empty_bootsrap_data(self):
|
||||
def test_get_from_empty_bootstrap_data(self):
|
||||
if utils.backend() == "postgresql":
|
||||
# failing
|
||||
return
|
||||
|
|
|
|||
|
|
@ -55,11 +55,11 @@ def test_extract_errors() -> None:
|
|||
|
||||
from superset.db_engine_specs.athena import AthenaEngineSpec
|
||||
|
||||
msg = ": mismatched input 'fromm'. Expecting: "
|
||||
msg = ": mismatched input 'from_'. Expecting: "
|
||||
result = AthenaEngineSpec.extract_errors(Exception(msg))
|
||||
assert result == [
|
||||
SupersetError(
|
||||
message='Please check your query for syntax errors at or near "fromm". Then, try running your query again.',
|
||||
message='Please check your query for syntax errors at or near "from_". Then, try running your query again.',
|
||||
error_type=SupersetErrorType.SYNTAX_ERROR,
|
||||
level=ErrorLevel.ERROR,
|
||||
extra={
|
||||
|
|
|
|||
|
|
@ -178,12 +178,12 @@ def test_extract_errors() -> None:
|
|||
Test that custom error messages are extracted correctly.
|
||||
"""
|
||||
|
||||
msg = ": mismatched input 'fromm'. Expecting: "
|
||||
msg = ": mismatched input 'from_'. Expecting: "
|
||||
result = DatabricksNativeEngineSpec.extract_errors(Exception(msg))
|
||||
|
||||
assert result == [
|
||||
SupersetError(
|
||||
message=": mismatched input 'fromm'. Expecting: ",
|
||||
message=": mismatched input 'from_'. Expecting: ",
|
||||
error_type=SupersetErrorType.GENERIC_DB_ENGINE_ERROR,
|
||||
level=ErrorLevel.ERROR,
|
||||
extra={
|
||||
|
|
@ -204,13 +204,13 @@ def test_extract_errors_with_context() -> None:
|
|||
Test that custom error messages are extracted correctly with context.
|
||||
"""
|
||||
|
||||
msg = ": mismatched input 'fromm'. Expecting: "
|
||||
msg = ": mismatched input 'from_'. Expecting: "
|
||||
context = {"hostname": "foo"}
|
||||
result = DatabricksNativeEngineSpec.extract_errors(Exception(msg), context)
|
||||
|
||||
assert result == [
|
||||
SupersetError(
|
||||
message=": mismatched input 'fromm'. Expecting: ",
|
||||
message=": mismatched input 'from_'. Expecting: ",
|
||||
error_type=SupersetErrorType.GENERIC_DB_ENGINE_ERROR,
|
||||
level=ErrorLevel.ERROR,
|
||||
extra={
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ def test_where_clause_n_prefix() -> None:
|
|||
assert query == query_expected
|
||||
|
||||
|
||||
def test_time_exp_mixd_case_col_1y() -> None:
|
||||
def test_time_exp_mixed_case_col_1y() -> None:
|
||||
from superset.db_engine_specs.mssql import MssqlEngineSpec
|
||||
|
||||
col = column("MixedCase")
|
||||
|
|
@ -291,14 +291,14 @@ def test_extract_errors() -> None:
|
|||
msg = dedent(
|
||||
"""
|
||||
DB-Lib error message 20009, severity 9:
|
||||
Unable to connect: Adaptive Server is unavailable or does not exist (locahost)
|
||||
Unable to connect: Adaptive Server is unavailable or does not exist (localhost_)
|
||||
"""
|
||||
)
|
||||
result = MssqlEngineSpec.extract_errors(Exception(msg))
|
||||
assert result == [
|
||||
SupersetError(
|
||||
error_type=SupersetErrorType.CONNECTION_INVALID_HOSTNAME_ERROR,
|
||||
message='The hostname "locahost" cannot be resolved.',
|
||||
message='The hostname "localhost_" cannot be resolved.',
|
||||
level=ErrorLevel.ERROR,
|
||||
extra={
|
||||
"engine_name": "Microsoft SQL Server",
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ def test_pivot_fill_values():
|
|||
|
||||
def test_pivot_fill_column_values():
|
||||
"""
|
||||
Make sure pivot witn null column names returns correct DataFrame
|
||||
Make sure pivot with null column names returns correct DataFrame
|
||||
"""
|
||||
df_copy = categories_df.copy()
|
||||
df_copy["category"] = None
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ def test_should_raise_exception_duplication():
|
|||
)
|
||||
|
||||
|
||||
def test_should_raise_exception_duplication_on_multiindx():
|
||||
def test_should_raise_exception_duplication_on_multiindex():
|
||||
iterables = [["m1", "m2"], ["a", "b"], ["x", "y"]]
|
||||
columns = pd.MultiIndex.from_product(iterables, names=[None, "level1", "level2"])
|
||||
df = pd.DataFrame(index=[0, 1, 2], columns=columns, data=1)
|
||||
|
|
|
|||
|
|
@ -1551,7 +1551,7 @@ def test_insert_rls_as_subquery(
|
|||
"id=42",
|
||||
"SELECT * FROM other_table WHERE 1=1",
|
||||
),
|
||||
# If there's no pre-existing WHERE clause we create one.
|
||||
# If there's no preexisting WHERE clause we create one.
|
||||
(
|
||||
"SELECT * FROM table",
|
||||
"table",
|
||||
|
|
|
|||
Loading…
Reference in New Issue