aminghadersohi commented on code in PR #44180:
URL: https://github.com/apache/superset/pull/44180#discussion_r4018175054


##########
superset/views/core.py:
##########
@@ -681,7 +681,7 @@ def fetch_datasource_metadata(self) -> FlaskResponse:
         )
         # Check if datasource exists
         if not datasource:
-            return json_error_response(DATASOURCE_MISSING_ERR)
+            return json_error_response(str(DATASOURCE_MISSING_ERR))

Review Comment:
   `json_error_response` dispatches on `isinstance(error_details, str)` with no 
`else`, and `LazyString` is not a `str` subclass. Drop this `str()` and the 
body becomes `{}` — message silently gone — yet all 27 new tests still pass. No 
fence: the fix is a test, not a line here.



##########
superset/exceptions.py:
##########
@@ -206,7 +206,26 @@ class SpatialException(SupersetException):
 
 
 class CertificateException(SupersetException):
-    message = _("Invalid certificate")
+    def __init__(
+        self,
+        message: str = "",
+        exception: Optional[Exception] = None,
+        error_type: Optional[SupersetErrorType] = None,
+    ) -> None:
+        """Translate the default certificate error when constructing the 
exception.
+
+        Deliberately diverges from the sibling pattern of a class-level
+        ``message`` default: translating at construction resolves to a

Review Comment:
   Parsed all 49 classes in this file: `CertificateException` was the **only** 
subclass carrying a class-level `message` default (`SupersetException.message = 
""` is the base, not a sibling). No sibling pattern to diverge from — this 
converges on what the other 47 already do.
   ```suggestion
           Drops the class-level ``message`` default that made this the only
           such subclass: translating at construction resolves to a
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to