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: per-db add metrics #20990

Merged
merged 2 commits into from
Aug 8, 2022

Conversation

betodealmeida
Copy link
Member

@betodealmeida betodealmeida commented Aug 5, 2022

SUMMARY

This PR adds a method called get_metrics to the Database model and the base DB engine spec. It allows DB engine specs to return custom metrics for a given dataset, so that when a user adds a new dataset it can have more metrics than just COUNT(*) (the current behavior).

Currently no DB engine spec implements get_metrics, but in the future it could be leveraged by DB engine specs that have a semantic layer (like https://cube.dev/).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

Added tests.

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

@codecov
Copy link

codecov bot commented Aug 5, 2022

Codecov Report

Merging #20990 (b07589d) into master (eec6e57) will decrease coverage by 0.82%.
The diff coverage is 67.64%.

❗ Current head b07589d differs from pull request most recent head 595e41d. Consider uploading reports for the commit 595e41d to get more accurate results

@@            Coverage Diff             @@
##           master   #20990      +/-   ##
==========================================
- Coverage   66.34%   65.51%   -0.83%     
==========================================
  Files        1767     1767              
  Lines       67284    67308      +24     
  Branches     7140     7144       +4     
==========================================
- Hits        44642    44100     -542     
- Misses      20815    21380     +565     
- Partials     1827     1828       +1     
Flag Coverage Δ
hive ?
mysql ?
postgres ?
presto 53.05% <85.71%> (+0.01%) ⬆️
python 79.77% <95.23%> (-1.70%) ⬇️
sqlite 79.59% <95.23%> (+<0.01%) ⬆️
unit 50.49% <85.71%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
...ntend/src/explore/components/ExploreChartPanel.jsx 67.60% <0.00%> (-1.41%) ⬇️
.../src/views/CRUD/data/dataset/DatasetPage/index.tsx 0.00% <0.00%> (ø)
.../explore/components/ExploreViewContainer/index.jsx 52.45% <75.00%> (+0.26%) ⬆️
superset/common/query_context_processor.py 89.28% <80.00%> (-0.36%) ⬇️
superset/connectors/sqla/models.py 89.79% <100.00%> (-0.54%) ⬇️
superset/db_engine_specs/base.py 87.94% <100.00%> (-0.26%) ⬇️
superset/models/core.py 88.03% <100.00%> (-0.67%) ⬇️
superset/db_engines/hive.py 0.00% <0.00%> (-85.19%) ⬇️
superset/datasets/commands/update.py 25.00% <0.00%> (-69.05%) ⬇️
superset/datasets/commands/create.py 29.41% <0.00%> (-68.63%) ⬇️
... and 36 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@pull-request-size pull-request-size bot added size/L and removed size/M labels Aug 5, 2022
@betodealmeida betodealmeida requested a review from eschutho August 5, 2022 18:48
@betodealmeida betodealmeida merged commit bb3871d into apache:master Aug 8, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 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/L 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants