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 (native sync): split imports and more #124

Merged
merged 1 commit into from
Oct 20, 2022
Merged

Conversation

betodealmeida
Copy link
Member

@betodealmeida betodealmeida commented Oct 20, 2022

This PR introduces a few changes to the superset sync native command:

  1. The --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.
  2. The command now uses the /api/v1/assets/import endpoint in Superset, requiring a single request instead of 4 separate requests.
  3. A new option --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.

@betodealmeida betodealmeida force-pushed the split_import branch 2 times, most recently from 33b3e1d to 74a870d Compare October 20, 2022 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support large imports with thousands of files
1 participant