dpgaspar commented on code in PR #28317:
URL: https://github.com/apache/superset/pull/28317#discussion_r1591058149
##########
superset/databases/api.py:
##########
@@ -589,6 +594,70 @@ def delete(self, pk: int) -> Response:
)
return self.response_422(message=str(ex))
+ @expose("/<int:pk>/catalogs/")
+ @protect()
+ @safe
+ @rison(database_catalogs_query_schema)
+ @statsd_metrics
+ @event_logger.log_this_with_context(
+ action=lambda self, *args, **kwargs: f"{self.__class__.__name__}"
f".catalogs",
+ log_to_statsd=False,
+ )
+ def catalogs(self, pk: int, **kwargs: Any) -> FlaskResponse:
+ """Get all catalogs from a database.
+ ---
+ get:
+ summary: Get all catalogs from a database
+ parameters:
+ - in: path
+ schema:
+ type: integer
+ name: pk
+ description: The database id
+ - in: query
+ name: q
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/database_catalogs_query_schema'
+ responses:
+ 200:
+ description: A List of all catalogs from the database
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/CatalogsResponseSchema"
+ 400:
+ $ref: '#/components/responses/400'
+ 401:
+ $ref: '#/components/responses/401'
+ 404:
+ $ref: '#/components/responses/404'
+ 500:
+ $ref: '#/components/responses/500'
+ """
+ database = self.datamodel.get(pk, self._base_filters)
Review Comment:
`database = DatabaseDAO.find_by_id(pk)`
--
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]