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

other: Blossom metric fields for dataset API column selection #20732

Merged
merged 1 commit into from
Jul 20, 2022

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Jul 16, 2022

SUMMARY

Like for columns, this PR enables one to select specific metric fields in the dataset API.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

CI and tested in the Swagger UI, i.e., tested the GET /api/v1/dataset/{pk} RESTful API endpoint with the following query:

{
  "columns": [
    "columns.advanced_data_type",
    "metrics.changed_on",
    "metrics.created_on",
    "metrics.d3format",
    "metrics.description",
    "metrics.expression",
    "metrics.extra",
    "metrics.id",
    "metrics.metric_name",
    "metrics.metric_type",
    "metrics.verbose_name",
    "metrics.warning_text"
  ],
  "keys": [
    "none"
  ]
}

Also confirmed that,

{
  "columns": [
    "metrics"
  ],
  "keys": [
    "none"
  ]
}

still works for backwards compatibility and,

{
  "columns": [
    "metrics",
    "metrics.id"
  ],
  "keys": [
    "none"
  ]
}

only returns the metric ID, i.e., the metrics column is superseded by the metrics.id column, which is consistent from a deprecation standpoint.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • 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

@@ -162,7 +163,18 @@ class DatasetRestApi(BaseSupersetModelRestApi):
"columns.type",
"columns.uuid",
"columns.verbose_name",
"metrics",
"metrics", # TODO(john-bodley): Deprecate in 3.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.

Ensures backwards compatibility, i.e., non-breaking change.

Copy link
Member

Choose a reason for hiding this comment

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

what's the harm of keeping them both?

@codecov
Copy link

codecov bot commented Jul 16, 2022

Codecov Report

Merging #20732 (1d5473e) into master (bbaa4cc) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #20732   +/-   ##
=======================================
  Coverage   66.36%   66.36%           
=======================================
  Files        1754     1754           
  Lines       66673    66673           
  Branches     7049     7049           
=======================================
  Hits        44249    44249           
  Misses      20627    20627           
  Partials     1797     1797           
Flag Coverage Δ
hive 53.22% <ø> (ø)
javascript 51.93% <ø> (ø)
mysql 81.18% <ø> (ø)
postgres 81.26% <ø> (ø)
presto 53.08% <ø> (ø)
python 81.70% <ø> (ø)
sqlite 81.07% <ø> (ø)
unit 50.44% <ø> (ø)

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

Impacted Files Coverage Δ
superset/datasets/api.py 88.52% <ø> (ø)

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 bbaa4cc...1d5473e. Read the comment docs.

@john-bodley john-bodley changed the title refactor: Blossom metric fields for dataset API column selection other: Blossom metric fields for dataset API column selection Jul 16, 2022
@john-bodley john-bodley merged commit 5a04a28 into master Jul 20, 2022
@john-bodley john-bodley deleted the john-bodley--datasets-api-column-selection branch August 5, 2022 15:21
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 labels Mar 13, 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/S 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants