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 for asset sync #19220

Merged
merged 5 commits into from
Mar 22, 2022
Merged

feat: API for asset sync #19220

merged 5 commits into from
Mar 22, 2022

Conversation

betodealmeida
Copy link
Member

@betodealmeida betodealmeida commented Mar 16, 2022

SUMMARY

This PR exposes ExportAssetsCommand and ImportAssetsCommand via an API, allowing users to synchronize their Superset models to and from source control.

This depends on #19217.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

I added unit tests for both API endpoints.

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 Mar 17, 2022

Codecov Report

Merging #19220 (8a61210) into master (51061f0) will decrease coverage by 0.27%.
The diff coverage is 76.92%.

❗ Current head 8a61210 differs from pull request most recent head 73e0e57. Consider uploading reports for the commit 73e0e57 to get more accurate results

@@            Coverage Diff             @@
##           master   #19220      +/-   ##
==========================================
- Coverage   66.76%   66.49%   -0.28%     
==========================================
  Files        1670     1671       +1     
  Lines       64392    64618     +226     
  Branches     6499     6504       +5     
==========================================
- Hits        42991    42967      -24     
- Misses      19718    19967     +249     
- Partials     1683     1684       +1     
Flag Coverage Δ
hive ?
mysql 81.64% <88.68%> (-0.33%) ⬇️
postgres 81.69% <88.68%> (-0.33%) ⬇️
presto ?
python 81.77% <88.68%> (-0.67%) ⬇️
sqlite 81.46% <88.68%> (-0.32%) ⬇️

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

Impacted Files Coverage Δ
...ntend/packages/superset-ui-core/src/color/index.ts 100.00% <ø> (ø)
.../src/time-format/TimeFormatterRegistrySingleton.ts 100.00% <ø> (ø)
...ackages/superset-ui-core/src/utils/featureFlags.ts 100.00% <ø> (ø)
...end/plugins/legacy-plugin-chart-chord/src/Chord.js 0.00% <0.00%> (ø)
...ns/legacy-plugin-chart-chord/src/transformProps.js 0.00% <0.00%> (ø)
.../legacy-plugin-chart-country-map/src/CountryMap.js 0.00% <0.00%> (ø)
...acy-plugin-chart-country-map/src/transformProps.js 0.00% <0.00%> (ø)
...ns/legacy-plugin-chart-histogram/src/Histogram.jsx 0.00% <0.00%> (ø)
...egacy-plugin-chart-histogram/src/transformProps.js 0.00% <ø> (ø)
...ns/legacy-plugin-chart-horizon/src/controlPanel.ts 100.00% <ø> (+50.00%) ⬆️
... and 147 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 51061f0...73e0e57. Read the comment docs.

@betodealmeida betodealmeida changed the base branch from export_import_assets to master March 17, 2022 17:54
@betodealmeida betodealmeida force-pushed the import_export_assets_api branch 2 times, most recently from 8b7cabd to 64625ee Compare March 17, 2022 22:12
superset/views/importexport/api.py Outdated Show resolved Hide resolved
tests/unit_tests/conftest.py Show resolved Hide resolved
tests/unit_tests/views/importexport/api_test.py Outdated Show resolved Hide resolved
tests/unit_tests/views/importexport/api_test.py Outdated Show resolved Hide resolved
Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for the new API!

@betodealmeida betodealmeida merged commit b05e7db into master Mar 22, 2022
michael-hoffman-26 pushed a commit to nielsen-oss/superset that referenced this pull request Mar 23, 2022
* feat: API for asset sync

* Add unit tests.

* Improve tests

* Move files

* Add more tests
villebro pushed a commit that referenced this pull request Apr 3, 2022
* feat: API for asset sync

* Add unit tests.

* Improve tests

* Move files

* Add more tests

(cherry picked from commit b05e7db)
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
* feat: API for asset sync

* Add unit tests.

* Improve tests

* Move files

* Add more tests
@mistercrunch mistercrunch added 🍒 1.5.0 🍒 1.5.1 🍒 1.5.2 🍒 1.5.3 🏷️ 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
@mistercrunch mistercrunch deleted the import_export_assets_api branch March 26, 2024 16:13
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 lts-v1 size/XL 🍒 1.5.0 🍒 1.5.1 🍒 1.5.2 🍒 1.5.3 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants