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(datasets): Change in API to create virtual datasets #21840

Merged
merged 3 commits into from
Oct 19, 2022

Conversation

sinhashubham95
Copy link
Contributor

@sinhashubham95 sinhashubham95 commented Oct 17, 2022

SUMMARY

The create API for datasets only allows the creation of physical datasets. This makes the ability to directly create virtual datasets not possible. This adds a support for the same. This is a non-breaking change, adding a non-mandatory parameter in the request body.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

NA

TESTING INSTRUCTIONS

curl --location --request POST 'http://localhost:8088/api/v1/dataset/' \ --header 'Content-Type: application/json' \ --header 'Cookie: ${COOKIE}' \ --header 'Origin: http://localhost:8088' \ --header 'Referer: http://localhost:8088/swagger/v1' \ --header 'accept: application/json' \ --header 'X-csrftoken: ${CSRF_TOKEN}' \ --data-raw '{ "database": 1, "external_url": "", "is_managed_externally": false, "owners": [ 1 ], "sql": "select a.*,b.name from ab_permission_view a join ab_permission b on a.permission_id = b.id", "schema": "public", "table_name": "test1234" }'

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

@sinhashubham95 sinhashubham95 changed the title feat(datasets): API Support to create virtual datasets feat(datasets): Change in API to create virtual datasets Oct 17, 2022
@codecov
Copy link

codecov bot commented Oct 17, 2022

Codecov Report

Merging #21840 (5e84c5b) into master (8f4415b) will increase coverage by 0.74%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master   #21840      +/-   ##
==========================================
+ Coverage   66.18%   66.93%   +0.74%     
==========================================
  Files        1805     1805              
  Lines       69066    69068       +2     
  Branches     7369     7369              
==========================================
+ Hits        45712    46230     +518     
+ Misses      21448    20932     -516     
  Partials     1906     1906              
Flag Coverage Δ
hive 52.92% <50.00%> (-0.01%) ⬇️
mysql 78.35% <100.00%> (?)
postgres 78.41% <100.00%> (?)
presto 52.82% <50.00%> (-0.01%) ⬇️
python 81.47% <100.00%> (+1.54%) ⬆️
sqlite 76.89% <50.00%> (-0.01%) ⬇️
unit 51.06% <50.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
superset/datasets/api.py 87.39% <100.00%> (+35.77%) ⬆️
superset/datasets/commands/create.py 100.00% <100.00%> (+68.75%) ⬆️
superset/datasets/schemas.py 97.40% <100.00%> (+0.01%) ⬆️
superset/db_engine_specs/base.py 89.69% <0.00%> (+0.15%) ⬆️
superset/views/core.py 76.06% <0.00%> (+0.45%) ⬆️
superset/common/query_object.py 94.38% <0.00%> (+0.51%) ⬆️
superset/connectors/sqla/models.py 91.01% <0.00%> (+0.51%) ⬆️
superset/commands/importers/v1/utils.py 93.50% <0.00%> (+1.29%) ⬆️
superset/models/core.py 90.11% <0.00%> (+1.41%) ⬆️
superset/views/base_api.py 98.44% <0.00%> (+1.55%) ⬆️
... and 28 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@pull-request-size pull-request-size bot added size/M and removed size/S labels Oct 17, 2022
@sinhashubham95
Copy link
Contributor Author

@villebro can you please check on this?

@villebro villebro self-requested a review October 18, 2022 18:06
@villebro
Copy link
Member

Nice, I'll review shortly

@sinhashubham95
Copy link
Contributor Author

@villebro any update here?

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, thanks for implementing this and adding test coverage!

@villebro villebro merged commit decb2fb into apache:master Oct 19, 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/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants