You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "villebro (via GitHub)" <gi...@apache.org> on 2023/04/12 11:33:22 UTC

[GitHub] [superset] villebro commented on a diff in pull request #23655: feat: add verbose map to /dataset/:id endpoint [WIP]

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


##########
superset/datasets/api.py:
##########
@@ -248,6 +249,59 @@ class DatasetRestApi(BaseSupersetModelRestApi):
     list_outer_default_load = True
     show_outer_default_load = True
 
+    @expose("/<int:pk>", methods=["GET"])
+    @protect()
+    @safe
+    def get(self, pk: int, **kwargs: Any) -> Response:
+        """Get a dataset
+        ---
+        get:
+          description: >-
+            Get a dataset
+          parameters:
+          - in: path
+            schema:
+              type: integer
+            description: The dataset id
+            name: pk
+          responses:
+            200:
+              description: dataset
+              content:
+                application/json:
+                  schema:
+                    type: object

Review Comment:
   Could we add a full reference here? Before this change the schema looks like this:
   ![image](https://user-images.githubusercontent.com/33317356/231444398-edbccde5-48ea-4d02-aa68-54d377474059.png)
   and after this change it looks like this:
   <img width="1108" alt="image" src="https://user-images.githubusercontent.com/33317356/231444464-b3997f48-0e4a-4aac-ac75-d7100961e067.png">
   
   Check here for an example of how to add the schema:
   https://github.com/apache/superset/blob/c8fa44e9e904160de705cd643d1df092815348b1/superset/annotation_layers/annotations/api.py#L168-L186
   
   Also, please add `verbose_map` to the schema.



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org