feat(bigquery): Custom message when Service Account doesnt have the correct Roles and Permissions (#21838)

This commit is contained in:
Antonio Rivero Martinez
2022-10-26 20:44:09 -03:00
committed by GitHub
parent 059e53a39f
commit 203b289021
7 changed files with 86 additions and 21 deletions

View File

@@ -32,7 +32,6 @@ from superset.databases.commands.exceptions import (
DatabaseNotFoundError,
DatabaseSecurityUnsafeError,
DatabaseTestConnectionDriverError,
DatabaseTestConnectionFailedError,
DatabaseTestConnectionUnexpectedError,
)
from superset.databases.commands.export import ExportDatabasesCommand
@@ -683,7 +682,7 @@ class TestTestConnectionDatabaseCommand(SupersetTestCase):
json_payload = {"sqlalchemy_uri": db_uri}
command_without_db_name = TestConnectionDatabaseCommand(json_payload)
with pytest.raises(DatabaseTestConnectionFailedError) as excinfo:
with pytest.raises(SupersetErrorsException) as excinfo:
command_without_db_name.run()
assert (
excinfo.value.errors[0].error_type
@@ -757,7 +756,7 @@ class TestTestConnectionDatabaseCommand(SupersetTestCase):
json_payload = {"sqlalchemy_uri": db_uri}
command_without_db_name = TestConnectionDatabaseCommand(json_payload)
with pytest.raises(DatabaseTestConnectionFailedError) as excinfo:
with pytest.raises(SupersetErrorsException) as excinfo:
command_without_db_name.run()
assert str(excinfo.value) == (
"Connection failed, please check your connection settings"