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: add samples endpoint #20170

Merged
merged 6 commits into from
May 25, 2022
Merged

Conversation

zhaoyongjie
Copy link
Member

SUMMARY

Add a new samples endpoint for getting dataset sampling

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

  1. run superset init
  2. login Superset
  3. open http://localhost:9000/api/v1/dataset/<dataset_id>/samples in browser
  4. open http://localhost:9000/api/v1/dataset/<dataset_id>/samples?force=true to force query

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

@zhaoyongjie zhaoyongjie marked this pull request as ready for review May 24, 2022 12:45
@villebro
Copy link
Member

Looks great @zhaoyongjie ! Can we add a few simple tests?

@zhaoyongjie
Copy link
Member Author

Looks great @zhaoyongjie ! Can we add a few simple tests?

Sure, I will do.

@codecov
Copy link

codecov bot commented May 24, 2022

Codecov Report

Merging #20170 (2935947) into master (ce01ce9) will decrease coverage by 0.17%.
The diff coverage is 71.05%.

❗ Current head 2935947 differs from pull request most recent head 6323a22. Consider uploading reports for the commit 6323a22 to get more accurate results

@@            Coverage Diff             @@
##           master   #20170      +/-   ##
==========================================
- Coverage   66.44%   66.27%   -0.18%     
==========================================
  Files        1721     1722       +1     
  Lines       64548    64605      +57     
  Branches     6811     6811              
==========================================
- Hits        42890    42815      -75     
- Misses      19925    20057     +132     
  Partials     1733     1733              
Flag Coverage Δ
hive ?
mysql 82.13% <77.19%> (-0.01%) ⬇️
postgres 82.19% <77.19%> (-0.01%) ⬇️
presto ?
python 82.24% <77.19%> (-0.40%) ⬇️
sqlite ?
unit ?

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

Impacted Files Coverage Δ
...ugin-chart-table/src/DataTable/hooks/useSticky.tsx 4.21% <0.00%> (ø)
...nd/plugins/plugin-chart-table/src/controlPanel.tsx 16.66% <0.00%> (ø)
superset/constants.py 100.00% <ø> (ø)
...tend/plugins/plugin-chart-table/src/TableChart.tsx 39.00% <33.33%> (ø)
superset/datasets/api.py 86.30% <61.11%> (-2.04%) ⬇️
...ins/plugin-chart-table/src/DataTable/DataTable.tsx 38.54% <66.66%> (ø)
superset/datasets/commands/samples.py 83.33% <83.33%> (ø)
...d/plugins/plugin-chart-table/src/transformProps.ts 64.44% <100.00%> (ø)
superset/datasets/commands/exceptions.py 93.44% <100.00%> (+0.22%) ⬆️
superset/views/base.py 74.01% <100.00%> (+0.08%) ⬆️
... and 18 more

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 ce01ce9...6323a22. Read the comment docs.

fix ut

fix UT
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

Second pass comments, mostly nits

superset/datasets/commands/exceptions.py Outdated Show resolved Hide resolved
superset/datasets/api.py Outdated Show resolved Hide resolved
tests/integration_tests/datasets/api_tests.py Outdated Show resolved Hide resolved
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM, I look forward to getting rid of samples in the regular chart data endpoint!

@zhaoyongjie zhaoyongjie merged commit 40abb44 into apache:master May 25, 2022
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.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/L 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants