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

chore: consolidate datasource import logic #11533

Merged
merged 6 commits into from
Nov 12, 2020

Conversation

betodealmeida
Copy link
Member

@betodealmeida betodealmeida commented Nov 3, 2020

Note: this is a stacked PR, dependent on #11529.

SUMMARY

Currently the import functionality of Superset is split between the ImportExportMixin and the import_obj method in some of the models.

This PR finalizes the process of getting rid of the import_obj method, started in #11529, consolidating all the import functionality in a single place to make it easier to preserve backwards compatibility once we implement #11167.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TEST PLAN

Updated unit tests.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@codecov-io
Copy link

codecov-io commented Nov 3, 2020

Codecov Report

Merging #11533 (858289f) into master (4a070cf) will decrease coverage by 6.83%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11533      +/-   ##
==========================================
- Coverage   62.25%   55.42%   -6.84%     
==========================================
  Files         874      406     -468     
  Lines       42325    14344   -27981     
  Branches     3972     3691     -281     
==========================================
- Hits        26350     7950   -18400     
+ Misses      15795     6231    -9564     
+ Partials      180      163      -17     
Flag Coverage Δ
cypress 55.42% <ø> (?)
javascript ?
python ?

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

Impacted Files Coverage Δ
...uperset-frontend/src/dashboard/util/dnd-reorder.js 0.00% <0.00%> (-100.00%) ⬇️
...rset-frontend/src/dashboard/util/getEmptyLayout.js 0.00% <0.00%> (-100.00%) ⬇️
...dashboard/components/resizable/ResizableHandle.jsx 0.00% <0.00%> (-100.00%) ⬇️
.../src/dashboard/util/getFilterScopeFromNodesTree.js 0.00% <0.00%> (-93.48%) ⬇️
...src/dashboard/components/gridComponents/Header.jsx 10.52% <0.00%> (-86.85%) ⬇️
...rc/dashboard/components/gridComponents/Divider.jsx 13.33% <0.00%> (-86.67%) ⬇️
...set-frontend/src/views/CRUD/welcome/EmptyState.tsx 5.71% <0.00%> (-82.10%) ⬇️
...et-frontend/src/components/ListView/ActionsBar.tsx 11.11% <0.00%> (-81.20%) ⬇️
...et-frontend/src/components/Menu/LanguagePicker.tsx 0.00% <0.00%> (-80.00%) ⬇️
superset-frontend/src/components/Link.tsx 7.69% <0.00%> (-79.81%) ⬇️
... and 769 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 4a070cf...858289f. Read the comment docs.

@@ -324,7 +325,7 @@ def run(self) -> None:
self.validate()

for file_name, content in self.contents.items():
logger.info(f"Importing dashboard from file {file_name}")
logger.info("Importing dashboard from file %s", file_name)
Copy link
Member

Choose a reason for hiding this comment

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

can we keep fstrings here?

Copy link
Member Author

Choose a reason for hiding this comment

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

@hughhhh when logging pylint actually recommends string interpolation, since it's faster (the string is interpolated only if the log level is being recorded) and safer (if the string interpolation fails something is still logged). I changed it here because pylint was complaining.

@betodealmeida betodealmeida changed the base branch from command_import_dash to master November 11, 2020 23:22
@betodealmeida betodealmeida merged commit 45738ff into apache:master Nov 12, 2020
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
* Consolidate dash import logic

* WIP

* Add license

* Fix lint

* Retrigger tests

* Fix lint
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.0.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/XL 🚢 1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants