villebro commented on code in PR #35004:
URL: https://github.com/apache/superset/pull/35004#discussion_r2322919504


##########
superset/databases/api.py:
##########
@@ -727,7 +727,8 @@ def catalogs(self, pk: int, **kwargs: Any) -> FlaskResponse:
                 database,
                 catalogs,
             )
-            return self.response(200, result=list(catalogs))
+            default_catalog = database.get_default_catalog()
+            return self.response(200, result=list(catalogs), 
default=default_catalog)

Review Comment:
   I agree with AI here that we need to update `CatalogsResponseSchema`. Also, 
if I'm not mistaken, this slightly deviates from the convention of 
result/results being the full response payload. It feels the canonical solution 
here would be to replace the list of catalog names with something like
   ```
   results = [
     {
       "name": "my_catalog",
       "default": false,
     },
     {
       "name": "my_other_catalog",
       "default": true,
     },
   ]
   ```
   
    But of course that would require a breaking change.  So maybe let's just 
proceed with this approach and maybe consider refactoring later during a 
breaking window.



-- 
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