feat (native sync): split imports and more #124
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a few changes to the
superset sync native
command:--asset-type
option was removed, since it was broken. When importing an asset (say, a dataset) all related assets should be included in the bundle (database, in this example), which defeats the purpose of syncing only a few assets./api/v1/assets/import
endpoint in Superset, requiring a single request instead of 4 separate requests.--split
was added. When set the CLI will imports assets one by one (with related assets), starting with databases, then datasets, charts, dashboards.$ preset-cli --workspaces=https://816a0e96.us2a.app.preset.io/ superset sync native ~/Projects/headless-bi-blog-post-examples/ --overwrite --split https://816a0e96.us2a.app.preset.io/ [11:56:24] INFO [[11:56:24]] INFO: preset_cli.cli.superset.sync.native.command: Importing databases/Google_Sheets.yaml command.py:220 [11:56:27] INFO [[11:56:27]] INFO: preset_cli.cli.superset.sync.native.command: Importing datasets/Google_Sheets/country_cnt.yaml command.py:220 [11:56:29] INFO [[11:56:29]] INFO: preset_cli.cli.superset.sync.native.command: Importing charts/Count_per_country_79.yaml command.py:220 [11:56:30] INFO [[11:56:30]] INFO: preset_cli.cli.superset.sync.native.command: Importing dashboards/Demo_dashboard.yaml
Closes #123.