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

rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new ba0900d2b32 fix(semantic-layers): show a friendly warning when schema 
enrichment falls back (#42400)
ba0900d2b32 is described below

commit ba0900d2b32fc4b294d5192312b136cd1851b349
Author: Evan Rusackas <[email protected]>
AuthorDate: Sun Jul 26 02:57:17 2026 -0700

    fix(semantic-layers): show a friendly warning when schema enrichment falls 
back (#42400)
    
    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