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: import configuration from directory #15686

Merged
merged 2 commits into from
Aug 12, 2021

Conversation

betodealmeida
Copy link
Member

@betodealmeida betodealmeida commented Jul 14, 2021

SUMMARY

This allows us to keep Superset updated from a repo:

$ superset import-directory /path/to/configs/

For example, I created a simple dashboard with a single chart:

Screenshot 2021-07-14 at 11-08-02 Demo

I then exported it to a file dashboard_export_20210714T104600.zip and unzipped it. After deleting the dashboard, chart, dataset, and database I imported everything back with:

$ superset import-directory ~/Downloads/dashboard_export_20210714T104600/

I then changed the chart title in ~/Downloads/dashboard_export_20210714T104600/charts/Cnt_per_country_1.yaml and ran the command again. The chart was succesfully updated:

Screenshot 2021-07-14 at 11-12-01 Demo

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

  1. Export something (preferably a dashboard)
  2. Unzip export and modify a file (eg, a chart title)
  3. Run import-directory on the directory

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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 Jul 14, 2021

Codecov Report

Merging #15686 (391cca4) into master (5a84841) will increase coverage by 0.08%.
The diff coverage is 46.80%.

❗ Current head 391cca4 differs from pull request most recent head f956b89. Consider uploading reports for the commit f956b89 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15686      +/-   ##
==========================================
+ Coverage   76.50%   76.58%   +0.08%     
==========================================
  Files         996      996              
  Lines       53006    53091      +85     
  Branches     6739     6757      +18     
==========================================
+ Hits        40553    40662     +109     
+ Misses      12224    12203      -21     
+ Partials      229      226       -3     
Flag Coverage Δ
mysql 81.54% <46.80%> (-0.06%) ⬇️
postgres 81.57% <46.80%> (-0.06%) ⬇️
python 81.65% <46.80%> (-0.06%) ⬇️
sqlite 81.21% <46.80%> (-0.06%) ⬇️

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

Impacted Files Coverage Δ
superset/datasets/commands/importers/v1/utils.py 58.97% <0.00%> (ø)
superset/examples/utils.py 28.57% <28.00%> (-3.43%) ⬇️
superset/cli.py 51.79% <66.66%> (-0.19%) ⬇️
superset/commands/importers/v1/examples.py 39.53% <87.50%> (+4.09%) ⬆️
superset/dashboards/commands/importers/v1/utils.py 80.59% <100.00%> (ø)
superset/examples/__init__.py 100.00% <100.00%> (ø)
...rontend/src/components/ListView/CardCollection.tsx 76.92% <0.00%> (-1.65%) ⬇️
superset/examples/deck.py 12.50% <0.00%> (ø)
superset-frontend/src/views/CRUD/utils.tsx 68.85% <0.00%> (ø)
...erset-frontend/src/datasource/DatasourceEditor.jsx 74.25% <0.00%> (ø)
... and 10 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 5a84841...f956b89. Read the comment docs.

@betodealmeida betodealmeida changed the title WIP feat: import configuration from directory Jul 14, 2021
@betodealmeida betodealmeida marked this pull request as ready for review July 14, 2021 18:34
@betodealmeida betodealmeida requested review from robdiciuccio and hughhhh and removed request for robdiciuccio July 14, 2021 18:34
@betodealmeida betodealmeida force-pushed the import_dir_command branch 4 times, most recently from 0207e8e to 0630576 Compare July 19, 2021 20:27
@betodealmeida betodealmeida force-pushed the import_dir_command branch 3 times, most recently from e8a6f50 to caef8a9 Compare August 11, 2021 00:00
This allows us to keep Superset updated from a repo:

```bash
$ superset import-directory /path/to/configs/
```

For example, I created a simple dashboard with a single chart:

PLACEHOLDER

I then exported it to a file `dashboard_export_20210714T104600.zip` and
unzipped it. After deleting the dashboard, chart, dataset, and database
I imported everything back with:

```bash
$ superset import-directory ~/Downloads/dashboard_export_20210714T104600/
```

I then changed the chart title in `~/Downloads/dashboard_export_20210714T104600/charts/Cnt_per_country_1.yaml` and ran the command again. The chart was succesfully updated:

PLACEHOLDER
@betodealmeida betodealmeida merged commit 7de54d0 into apache:master Aug 12, 2021
betodealmeida added a commit to preset-io/superset that referenced this pull request Aug 24, 2021
* feat: command to import configuration from a directory

This allows us to keep Superset updated from a repo:

```bash
$ superset import-directory /path/to/configs/
```

For example, I created a simple dashboard with a single chart:

PLACEHOLDER

I then exported it to a file `dashboard_export_20210714T104600.zip` and
unzipped it. After deleting the dashboard, chart, dataset, and database
I imported everything back with:

```bash
$ superset import-directory ~/Downloads/dashboard_export_20210714T104600/
```

I then changed the chart title in `~/Downloads/dashboard_export_20210714T104600/charts/Cnt_per_country_1.yaml` and ran the command again. The chart was succesfully updated:

PLACEHOLDER

* Small fixes
villebro pushed a commit to preset-io/superset that referenced this pull request Oct 13, 2021
* feat: command to import configuration from a directory

This allows us to keep Superset updated from a repo:

```bash
$ superset import-directory /path/to/configs/
```

For example, I created a simple dashboard with a single chart:

PLACEHOLDER

I then exported it to a file `dashboard_export_20210714T104600.zip` and
unzipped it. After deleting the dashboard, chart, dataset, and database
I imported everything back with:

```bash
$ superset import-directory ~/Downloads/dashboard_export_20210714T104600/
```

I then changed the chart title in `~/Downloads/dashboard_export_20210714T104600/charts/Cnt_per_country_1.yaml` and ran the command again. The chart was succesfully updated:

PLACEHOLDER

* Small fixes
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
* feat: command to import configuration from a directory

This allows us to keep Superset updated from a repo:

```bash
$ superset import-directory /path/to/configs/
```

For example, I created a simple dashboard with a single chart:

PLACEHOLDER

I then exported it to a file `dashboard_export_20210714T104600.zip` and
unzipped it. After deleting the dashboard, chart, dataset, and database
I imported everything back with:

```bash
$ superset import-directory ~/Downloads/dashboard_export_20210714T104600/
```

I then changed the chart title in `~/Downloads/dashboard_export_20210714T104600/charts/Cnt_per_country_1.yaml` and ran the command again. The chart was succesfully updated:

PLACEHOLDER

* Small fixes
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
* feat: command to import configuration from a directory

This allows us to keep Superset updated from a repo:

```bash
$ superset import-directory /path/to/configs/
```

For example, I created a simple dashboard with a single chart:

PLACEHOLDER

I then exported it to a file `dashboard_export_20210714T104600.zip` and
unzipped it. After deleting the dashboard, chart, dataset, and database
I imported everything back with:

```bash
$ superset import-directory ~/Downloads/dashboard_export_20210714T104600/
```

I then changed the chart title in `~/Downloads/dashboard_export_20210714T104600/charts/Cnt_per_country_1.yaml` and ran the command again. The chart was succesfully updated:

PLACEHOLDER

* Small fixes
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.0 labels Mar 12, 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 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants