You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/09/11 18:03:50 UTC

[GitHub] [superset] WingCode opened a new pull request #16673: Fix OpenAPI definition GET /dataset/

WingCode opened a new pull request #16673:
URL: https://github.com/apache/superset/pull/16673


   ### SUMMARY
   Update OpenAPI definition for the latest API response for database available. 
   In previous spec:
   1.  "ids" was expected to be string but currently in API response it is integer.
   2. "owner" was expected to be a single JSON object but currently in API response it is list of JSON objects.
   Example of API Response:
   ```json
   {
     "count": 3,
     "description_columns": {},
     "ids": [
       38,
       31,
       32
     ],
     "label_columns": {
       "changed_by.first_name": "Changed By First Name",
       "changed_by.username": "Changed By Username",
       "changed_by_name": "Changed By Name",
       "changed_by_url": "Changed By Url",
       "changed_on_delta_humanized": "Changed On Delta Humanized",
       "changed_on_utc": "Changed On Utc",
       "database.database_name": "Database Database Name",
       "database.id": "Database Id",
       "default_endpoint": "Default Endpoint",
       "explore_url": "Explore Url",
       "extra": "Extra",
       "id": "Id",
       "kind": "Kind",
       "owners.first_name": "Owners First Name",
       "owners.id": "Owners Id",
       "owners.last_name": "Owners Last Name",
       "owners.username": "Owners Username",
       "schema": "Schema",
       "sql": "Sql",
       "table_name": "Table Name"
     },
     "list_columns": [
       "id",
       "database.id",
       "database.database_name",
       "changed_by_name",
       "changed_by_url",
       "changed_by.first_name",
       "changed_by.username",
       "changed_on_utc",
       "changed_on_delta_humanized",
       "default_endpoint",
       "explore_url",
       "extra",
       "kind",
       "owners.id",
       "owners.username",
       "owners.first_name",
       "owners.last_name",
       "schema",
       "sql",
       "table_name"
     ],
     "list_title": "List Sqla Table",
     "order_columns": [
       "table_name",
       "schema",
       "changed_by.first_name",
       "changed_on_delta_humanized",
       "database.database_name"
     ],
     "result": [
       {
         "changed_by": {
           "first_name": "Superset",
           "username": "admin"
         },
         "changed_by_name": "Superset Admin",
         "changed_by_url": "/superset/profile/admin",
         "changed_on_delta_humanized": "6 days ago",
         "changed_on_utc": "2021-09-05T02:59:05.896249+0000",
         "database": {
           "database_name": "Presto",
           "id": 2
         },
         "default_endpoint": null,
         "explore_url": "/superset/explore/table/38/",
         "extra": null,
         "id": 38,
         "kind": "physical",
         "owners": [
           {
             "first_name": "Superset",
             "id": 1,
             "last_name": "Admin",
             "username": "admin"
           }
         ],
         "schema": "nosql1",
         "sql": null,
         "table_name": "image_features_table"
       },
       {
         "changed_by": {
           "first_name": "Superset",
           "username": "admin"
         },
         "changed_by_name": "Superset Admin",
         "changed_by_url": "/superset/profile/admin",
         "changed_on_delta_humanized": "7 days ago",
         "changed_on_utc": "2021-09-04T05:42:44.064370+0000",
         "database": {
           "database_name": "test",
           "id": 1
         },
         "default_endpoint": null,
         "explore_url": "/superset/explore/table/31/",
         "extra": null,
         "id": 31,
         "kind": "physical",
         "owners": [],
         "schema": "test",
         "sql": null,
         "table_name": "test"
       },
       {
         "changed_by": {
           "first_name": "Superset",
           "username": "admin"
         },
         "changed_by_name": "Superset Admin",
         "changed_by_url": "/superset/profile/admin",
         "changed_on_delta_humanized": "7 days ago",
         "changed_on_utc": "2021-09-04T04:52:44.327881+0000",
         "database": {
           "database_name": "test",
           "id": 1
         },
         "default_endpoint": null,
         "explore_url": "/superset/explore/table/32/",
         "extra": null,
         "id": 32,
         "kind": "physical",
         "owners": [],
         "schema": "test",
         "sql": null,
         "table_name": "test"
       }
     ]
   }
   ```
   
   ### TESTING INSTRUCTIONS
   Download the OpenAPI spec from http://localhost:8088/api/v1/_openapi
   Generate client
   ```shell
   java -jar openapi-generator-cli.jar generate -i ./openapi.json -g python -o ./superset_py/ --skip-validate-spec
   ```
   Test code
   ```python
   import openapi_client
   from openapi_client.api.dashboards_api import DashboardsApi
   from openapi_client.api.database_api import DatabaseApi
   
   configuration = openapi_client.Configuration(
       host= "http://localhost:8088/api/v1",
       username="admin",
       password="admin")
   api_client = openapi_client.ApiClient(configuration)
   dataset_api = DatasetsApi(api_client)
   datasets = dataset_api.dataset_get()
   print(datasets)
   ```
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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


[GitHub] [superset] dpgaspar commented on pull request #16673: chore: Fix OpenAPI definition GET /dataset/

Posted by GitBox <gi...@apache.org>.
dpgaspar commented on pull request #16673:
URL: https://github.com/apache/superset/pull/16673#issuecomment-966109642


   @WingCode makes perfect sense, but the OpenApi spec is auto generated so we need to fix this at the source.
   Please open an issue on https://github.com/dpgaspar/Flask-AppBuilder instead.


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


[GitHub] [superset] dpgaspar closed pull request #16673: chore: Fix OpenAPI definition GET /dataset/

Posted by GitBox <gi...@apache.org>.
dpgaspar closed pull request #16673:
URL: https://github.com/apache/superset/pull/16673


   


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