Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tests): Spelling #25454

Merged
merged 35 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9005e22
spelling: bootstrap
jsoref Sep 14, 2023
a2f4a6b
spelling: error
jsoref Sep 14, 2023
bb923b1
spelling: example
jsoref Sep 14, 2023
a707cf8
spelling: from-a
jsoref Sep 14, 2023
6769090
spelling: from
jsoref Sep 14, 2023
cefaea3
spelling: localhost
jsoref Sep 14, 2023
af5e325
spelling: mixed
jsoref Sep 14, 2023
4f16d62
spelling: multiindex
jsoref Sep 14, 2023
696182b
spelling: preexisting
jsoref Sep 14, 2023
5e38559
spelling: sqlite
jsoref Sep 14, 2023
7459b35
spelling: typeerror
jsoref Sep 27, 2023
bc26a02
spelling: with
jsoref Sep 14, 2023
f13015c
Merge branch 'master' into spelling-test
rusackas Aug 20, 2024
f53b710
Update tests/unit_tests/db_engine_specs/test_databricks.py
rusackas Aug 20, 2024
674c266
Update tests/unit_tests/db_engine_specs/test_databricks.py
rusackas Aug 20, 2024
9c5b277
Update tests/unit_tests/db_engine_specs/test_databricks.py
rusackas Aug 20, 2024
2a3f46f
Update tests/unit_tests/db_engine_specs/test_databricks.py
rusackas Aug 20, 2024
5d6ad12
Update tests/integration_tests/db_engine_specs/gsheets_tests.py
rusackas Aug 20, 2024
0ffcd6f
Update tests/integration_tests/db_engine_specs/bigquery_tests.py
rusackas Aug 20, 2024
a8f3991
Update tests/integration_tests/db_engine_specs/postgres_tests.py
rusackas Aug 20, 2024
8569c8e
Update tests/integration_tests/databases/api_tests.py
rusackas Aug 20, 2024
b8a407a
Update tests/integration_tests/db_engine_specs/bigquery_tests.py
rusackas Aug 20, 2024
9d832dc
Update tests/integration_tests/db_engine_specs/gsheets_tests.py
rusackas Aug 20, 2024
cdf12b3
Update tests/integration_tests/db_engine_specs/postgres_tests.py
rusackas Aug 20, 2024
cee4844
Update tests/integration_tests/databases/api_tests.py
rusackas Aug 20, 2024
8ecced5
Update tests/integration_tests/db_engine_specs/bigquery_tests.py
rusackas Aug 20, 2024
fa7a074
Update tests/integration_tests/db_engine_specs/gsheets_tests.py
rusackas Aug 20, 2024
032e92c
Update tests/integration_tests/db_engine_specs/postgres_tests.py
rusackas Aug 20, 2024
94c6fbf
Update tests/integration_tests/db_engine_specs/postgres_tests.py
rusackas Aug 20, 2024
812f574
Update tests/unit_tests/db_engine_specs/test_databricks.py
rusackas Aug 20, 2024
3b6578e
Update tests/unit_tests/db_engine_specs/test_databricks.py
rusackas Aug 20, 2024
71d91e2
Update tests/unit_tests/db_engine_specs/test_databricks.py
rusackas Aug 20, 2024
3ab56ce
Update tests/unit_tests/db_engine_specs/test_databricks.py
rusackas Aug 20, 2024
3c54947
Update tests/integration_tests/db_engine_specs/bigquery_tests.py
rusackas Aug 20, 2024
6f47641
Update tests/integration_tests/db_engine_specs/gsheets_tests.py
rusackas Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/integration_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _create_user(username: str, role: str = "Admin", password: str = "general"):
username,
"firstname",
"lastname",
"email@exaple.com",
"email@example.com",
security_manager.find_role(role),
password,
)
Expand Down
10 changes: 5 additions & 5 deletions tests/integration_tests/databases/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2185,17 +2185,17 @@ def test_test_connection_failed_invalid_hostname(
"""
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'
rusackas marked this conversation as resolved.
Show resolved Hide resolved
rusackas marked this conversation as resolved.
Show resolved Hide resolved
rusackas marked this conversation as resolved.
Show resolved Hide resolved
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_".',
rusackas marked this conversation as resolved.
Show resolved Hide resolved
error_type="CONNECTION_INVALID_HOSTNAME_ERROR",
level="error",
extra={
"hostname": "locahost",
"hostname": "localhost_",
rusackas marked this conversation as resolved.
Show resolved Hide resolved
"issue_codes": [
{
"code": 1007,
Expand All @@ -2212,7 +2212,7 @@ def test_test_connection_failed_invalid_hostname(

self.login(ADMIN_USERNAME)
data = {
"sqlalchemy_uri": "postgres://username:password@locahost:12345/db",
"sqlalchemy_uri": "postgres://username:password@localhost_:12345/db",
rusackas marked this conversation as resolved.
Show resolved Hide resolved
"database_name": "examples",
"impersonate_user": False,
"server_cert": None,
Expand Down Expand Up @@ -3840,7 +3840,7 @@ def test_validate_sql_errors(self):
Database API: validate SQL with errors
"""
request_payload = {
"sql": "SELECT col1 froma table1",
"sql": "SELECT col1 from_ table1",
"schema": None,
"template_params": None,
}
Expand Down
4 changes: 2 additions & 2 deletions tests/integration_tests/db_engine_specs/bigquery_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,11 @@ def test_extract_errors(self):
)
]

msg = 'Syntax error: Expected end of input but got identifier "fromm"'
msg = 'Syntax error: Expected end of input but got identifier "from_"'
rusackas marked this conversation as resolved.
Show resolved Hide resolved
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.',
rusackas marked this conversation as resolved.
Show resolved Hide resolved
error_type=SupersetErrorType.SYNTAX_ERROR,
level=ErrorLevel.ERROR,
extra={
Expand Down
4 changes: 2 additions & 2 deletions tests/integration_tests/db_engine_specs/gsheets_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ def test_extract_errors(self):
"""
Test that custom error messages are extracted correctly.
"""
msg = 'SQLError: near "fromm": syntax error'
msg = 'SQLError: near "from_": syntax error'
rusackas marked this conversation as resolved.
Show resolved Hide resolved
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.',
rusackas marked this conversation as resolved.
Show resolved Hide resolved
error_type=SupersetErrorType.SYNTAX_ERROR,
level=ErrorLevel.ERROR,
extra={
Expand Down
4 changes: 2 additions & 2 deletions tests/integration_tests/db_engine_specs/mysql_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ def test_extract_errors(self):
)
]

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={
Expand Down
10 changes: 5 additions & 5 deletions tests/integration_tests/db_engine_specs/postgres_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_time_exp_lowr_col_sec_1y(self):
"(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
"""
Expand Down Expand Up @@ -241,14 +241,14 @@ def test_extract_errors(self):
]

msg = (
'psql: error: could not translate host name "locahost" to address: '
rusackas marked this conversation as resolved.
Show resolved Hide resolved
'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",
Expand Down Expand Up @@ -421,11 +421,11 @@ def test_extract_errors(self):
)
]

msg = 'syntax error at or near "fromm"'
msg = 'syntax error at or near "from_"'
rusackas marked this conversation as resolved.
Show resolved Hide resolved
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.',
rusackas marked this conversation as resolved.
Show resolved Hide resolved
error_type=SupersetErrorType.SYNTAX_ERROR,
level=ErrorLevel.ERROR,
extra={
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/db_engine_specs/presto_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ def test_extract_error_message_orig(self):
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"})
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/event_logger_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_config_class_deprecation(self):
# 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):
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/sql_lab/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/unit_tests/db_engine_specs/test_athena.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: "
rusackas marked this conversation as resolved.
Show resolved Hide resolved
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.',
rusackas marked this conversation as resolved.
Show resolved Hide resolved
error_type=SupersetErrorType.SYNTAX_ERROR,
level=ErrorLevel.ERROR,
extra={
Expand Down
8 changes: 4 additions & 4 deletions tests/unit_tests/db_engine_specs/test_databricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: "
rusackas marked this conversation as resolved.
Show resolved Hide resolved
result = DatabricksNativeEngineSpec.extract_errors(Exception(msg))

assert result == [
SupersetError(
message=": mismatched input 'fromm'. Expecting: ",
message=": mismatched input 'from_'. Expecting: ",
rusackas marked this conversation as resolved.
Show resolved Hide resolved
error_type=SupersetErrorType.GENERIC_DB_ENGINE_ERROR,
level=ErrorLevel.ERROR,
extra={
Expand All @@ -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: "
rusackas marked this conversation as resolved.
Show resolved Hide resolved
context = {"hostname": "foo"}
result = DatabricksNativeEngineSpec.extract_errors(Exception(msg), context)

assert result == [
SupersetError(
message=": mismatched input 'fromm'. Expecting: ",
message=": mismatched input 'from_'. Expecting: ",
rusackas marked this conversation as resolved.
Show resolved Hide resolved
error_type=SupersetErrorType.GENERIC_DB_ENGINE_ERROR,
level=ErrorLevel.ERROR,
extra={
Expand Down
6 changes: 3 additions & 3 deletions tests/unit_tests/db_engine_specs/test_mssql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous.

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",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/pandas_postprocessing/test_pivot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/pandas_postprocessing/test_rename.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/sql_parse_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ def get_rls_for_table(
"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",
Expand Down
Loading