Compare commits

...

1 Commits

Author SHA1 Message Date
Evan Rusackas
1a16b2acec fix(semantic-layers): show a friendly warning when schema enrichment falls back
Enrichment failures (connection refused, driver quirks, etc.) were
toasted to the user verbatim, which reads as raw internals and varies
by driver. Replace it with a stable, translatable message pointing at
the server logs, where the full exception is already recorded.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 13:42:56 -07:00
2 changed files with 15 additions and 3 deletions

View File

@@ -614,8 +614,15 @@ class SemanticLayerRestApi(BaseSupersetApi):
warning: str | None = None
try:
schema = cls.get_configuration_schema(parsed_config)
except Exception as ex: # pylint: disable=broad-except
warning = str(ex)
except Exception: # pylint: disable=broad-except
# Show a stable, user-friendly message in the UI; the exception
# detail goes to the server log below.
warning = str(
t(
"Could not load metadata for this configuration; "
"showing the default form. See the server logs for details."
)
)
logger.exception(
"Error enriching semantic layer configuration schema for type %s",
sl_type,

View File

@@ -1186,7 +1186,12 @@ def test_configuration_schema_enrichment_error_fallback(
assert response.status_code == 200
assert response.json["result"] == {"type": "object"}
assert response.json["warning"] == "connection failed"
# The warning is a stable, user-friendly message; the exception detail
# only goes to the server log.
assert response.json["warning"] == (
"Could not load metadata for this configuration; "
"showing the default form. See the server logs for details."
)
assert mock_cls.get_configuration_schema.call_count == 2