Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: convert DatasetList schema filter to use new distinct api #10746

Merged
merged 1 commit into from
Sep 2, 2020

Conversation

nytai
Copy link
Member

@nytai nytai commented Sep 1, 2020

SUMMARY

  • Recently, a new api for fetching distinct column values (used for select filter values) was merged: feat: dataset REST API for distinct values #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

N/A

TEST PLAN

-CI, unit tests, manual testing.

ADDITIONAL INFORMATION

  • 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

@@ -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]}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed this to be compliant with the existing /related api

@nytai nytai marked this pull request as ready for review September 1, 2020 22:33
Copy link
Member

@dpgaspar dpgaspar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still failing: test_get_dataset_distinct_schema

@nytai nytai force-pushed the tai/update-list-view-filters branch from 3455f22 to 33ed74b Compare September 2, 2020 17:00
@pull-request-size pull-request-size bot added size/L and removed size/M labels Sep 2, 2020
@nytai nytai force-pushed the tai/update-list-view-filters branch from 33ed74b to 0fdec1e Compare September 2, 2020 17:14
@nytai nytai merged commit 5a43700 into apache:master Sep 2, 2020
@nytai nytai deleted the tai/update-list-view-filters branch September 2, 2020 18:07
amitmiran137 pushed a commit to ofekisr/incubator-superset that referenced this pull request Sep 7, 2020
…boards_permissions

* upstream/master: (32 commits)
  docs: Add a note to contributing.md on reporting security vulnerabilities (apache#10796)
  Fix: Include RLS filters for cache keys (apache#10805)
  feat: filters for database list view (apache#10772)
  fix: MVC show saved query (apache#10781)
  added creator column and adjusted order columns (apache#10789)
  security: disallow uuid package on jinja2 (apache#10794)
  feat: CRUD REST API for saved queries (apache#10777)
  fix: disable domain sharding on explore view (apache#10787)
  fix: can not type `0.05` in `TextControl` (apache#10778)
  fix: pivot table timestamp grouping (apache#10774)
  fix: add validator information to email/slack alerts (apache#10762)
  More Label touchups (margins) (apache#10722)
  fix: dashboard extra filters (apache#10692)
  fix: re-installing local superset in cache image (apache#10766)
  feat: SIP-34 table list view for databases (apache#10705)
  refactor: convert DatasetList schema filter to use new distinct api (apache#10746)
  chore: removing fsevents dependency (apache#10751)
  Fix precommit hook for docs/installation.rst (apache#10759)
  feat(database): POST, PUT, DELETE API endpoints (apache#10741)
  docs: Update OAuth configuration in installation.rst (apache#10748)
  ...
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants