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

feat(api): add featured datatypes to dashboard dataset ep #15188

Merged
merged 1 commit into from
Jun 16, 2021

Conversation

villebro
Copy link
Member

@villebro villebro commented Jun 16, 2021

SUMMARY

To be able to filter out unnecessary filter types on the native filters config form (primarily temporal filters, but potentially others later), we need to know what types of datatypes are available on the datasets that are referenced on the dashboard. While we recently added the type_generic field to the column object (see #14863) and could iterate through all columns to check if they are temporal or not, the list of columns that are returned by the response from api/v1/dashboard/<pk>/datasets have been pre-filtered to contain only a subset of the actually featured columns. Therefore, we either need to return the full list of columns in the response, or add a new field that contains a list of datatypes featured in the dataset columns. To avoid bloating the response payload, this PR proposes adding the latter, i.e. a new field column_types to the response, that contains a list of all GenericDataTypes that are featured in the dataset columns.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

With this change, a new property column_types is available on Redux:
image

TESTING INSTRUCTIONS

CI + updated test

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

@codecov
Copy link

codecov bot commented Jun 16, 2021

Codecov Report

Merging #15188 (6716a32) into master (6edf340) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 6716a32 differs from pull request most recent head b47ac07. Consider uploading reports for the commit b47ac07 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master   #15188   +/-   ##
=======================================
  Coverage   77.40%   77.40%           
=======================================
  Files         969      969           
  Lines       50021    50031   +10     
  Branches     6432     6432           
=======================================
+ Hits        38717    38727   +10     
  Misses      11099    11099           
  Partials      205      205           
Flag Coverage Δ
hive 81.42% <100.00%> (+<0.01%) ⬆️
mysql 81.69% <100.00%> (+<0.01%) ⬆️
postgres 81.71% <100.00%> (+<0.01%) ⬆️
python 82.09% <100.00%> (+<0.01%) ⬆️
sqlite 81.34% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/connectors/base/models.py 88.70% <100.00%> (+0.33%) ⬆️
superset/dashboards/schemas.py 99.37% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6edf340...b47ac07. Read the comment docs.

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.

LGTM

@villebro villebro merged commit 8360292 into apache:master Jun 16, 2021
@villebro villebro deleted the villebro/dataset-datatype branch June 16, 2021 09:36
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.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 preset-io size/S 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants