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 2020/09/01 00:49:22 UTC

[GitHub] [incubator-superset] nytai opened a new pull request #10746: refactor: convert DatasetList schema filter to use new distinct api

nytai opened a new pull request #10746:
URL: https://github.com/apache/incubator-superset/pull/10746


   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   - Recently, a new api for fetching distinct column values (used for select filter values) was merged: https://github.com/apache/incubator-superset/pull/10595. This PR updates the schemas filter for DatasetList to use the new api. It also creates a generic function for generating fetch functions, compliant with the react-select async api, for fetching distinct values on a resource. 
   
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   N/A
   ### TEST PLAN
   <!--- What steps should be taken to verify the changes -->
   -CI, unit tests, manual testing. 
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] 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.

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] [incubator-superset] nytai commented on a change in pull request #10746: refactor: convert DatasetList schema filter to use new distinct api

Posted by GitBox <gi...@apache.org>.
nytai commented on a change in pull request #10746:
URL: https://github.com/apache/incubator-superset/pull/10746#discussion_r480511927



##########
File path: superset/views/base_api.py
##########
@@ -412,5 +412,9 @@ def distinct(self, column_name: str, **kwargs: Any) -> FlaskResponse:
         # Apply pagination
         result = self.datamodel.apply_pagination(query, page, page_size).all()
         # produce response
-        result = [{"text": item[0]} for item in result if item[0] is not None]
+        result = [
+            {"text": item[0], "value": item[0]}

Review comment:
       changed this to be compliant with the existing `/related` 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.

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] [incubator-superset] nytai merged pull request #10746: refactor: convert DatasetList schema filter to use new distinct api

Posted by GitBox <gi...@apache.org>.
nytai merged pull request #10746:
URL: https://github.com/apache/incubator-superset/pull/10746


   


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

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