This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch fix/semantic-layer-fallback-warning
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 1a16b2acec23fb74ce43d94bb358c036366cbd63
Author: Evan Rusackas <[email protected]>
AuthorDate: Fri Jul 24 13:42:56 2026 -0700

    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 <[email protected]>
---
 superset/semantic_layers/api.py              | 11 +++++++++--
 tests/unit_tests/semantic_layers/api_test.py |  7 ++++++-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/superset/semantic_layers/api.py b/superset/semantic_layers/api.py
index a5fc9e49d4d..19773ce73c1 100644
--- a/superset/semantic_layers/api.py
+++ b/superset/semantic_layers/api.py
@@ -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,
diff --git a/tests/unit_tests/semantic_layers/api_test.py 
b/tests/unit_tests/semantic_layers/api_test.py
index 50a3170b9e5..5dd2a480a64 100644
--- a/tests/unit_tests/semantic_layers/api_test.py
+++ b/tests/unit_tests/semantic_layers/api_test.py
@@ -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
 
 

Reply via email to