fix(charts): improve error display for failed charts in dashboards (#37939)

This commit is contained in:
Enzo Martellucci
2026-02-21 00:14:48 +01:00
committed by GitHub
parent b290f71245
commit b565128fe7
4 changed files with 128 additions and 3 deletions

View File

@@ -757,6 +757,26 @@ def test_needs_oauth2_with_credentials_error(mocker: MockerFixture) -> None:
assert GSheetsEngineSpec.needs_oauth2(ex) is True
def test_needs_oauth2_with_default_credentials_not_found(
mocker: MockerFixture,
) -> None:
"""
Test that needs_oauth2 returns True when Application Default Credentials
are not configured.
"""
from superset.db_engine_specs.gsheets import GSheetsEngineSpec
g = mocker.patch("superset.db_engine_specs.gsheets.g")
g.user = mocker.MagicMock()
ex = Exception(
"Your default credentials were not found. To set up Application Default "
"Credentials, see https://cloud.google.com/docs/authentication/external/"
"set-up-adc for more information."
)
assert GSheetsEngineSpec.needs_oauth2(ex) is True
def test_needs_oauth2_with_other_error(mocker: MockerFixture) -> None:
"""
Test that needs_oauth2 returns False for other errors.