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

bugfix: cli export_datasources (fixes 7437) #7728

Merged
merged 2 commits into from
Jul 9, 2019
Merged

bugfix: cli export_datasources (fixes 7437) #7728

merged 2 commits into from
Jul 9, 2019

Conversation

Aylr
Copy link
Contributor

@Aylr Aylr commented Jun 18, 2019

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

  1. I needed a quick fix to move some datasources over to a new deployment.
  2. The dict sorting wasn't working.
  3. I implemented the quickest possible (read janky) fix by coercing to string.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

  1. Checkout & install
  2. superset db upgrade
  3. superset init
  4. superset load_examples
  5. superset export_datasources and note the yml output.

ADDITIONAL INFORMATION

  • Has associated issue: Fixes Exporting Datasource to YAML fails #7437
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

REVIEWERS

@codecov-io
Copy link

codecov-io commented Jun 18, 2019

Codecov Report

Merging #7728 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7728   +/-   ##
=======================================
  Coverage   65.77%   65.77%           
=======================================
  Files         459      459           
  Lines       21911    21911           
  Branches     2410     2410           
=======================================
  Hits        14411    14411           
  Misses       7379     7379           
  Partials      121      121
Impacted Files Coverage Δ
superset/models/helpers.py 85.54% <ø> (ø) ⬆️

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 f278faa...c5f2b71. Read the comment docs.

@Aylr Aylr changed the title [WIP] bugfix cli export_datasources (fixes 7437) bugfix cli export_datasources (fixes 7437) Jun 18, 2019
@Aylr Aylr changed the title bugfix cli export_datasources (fixes 7437) bugfix: cli export_datasources (fixes 7437) Jun 19, 2019
Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

I'm not super familiar with this code, but I would've expected a change to the import function if the export format was changing. Does this still work when you try to import the new exported file?

@mistercrunch
Copy link
Member

Actually I think the fix may be to not sort the list at all. I'm guessing the intention was to have a deterministic ordering so that aligns well in source control.

I think the ordering of the keys is stable/predictable given that it follow the export_fields ordering.

@Aylr
Copy link
Contributor Author

Aylr commented Jun 21, 2019

@mistercrunch I guessed that the sorting was for the same thoughtful reason - to reduce VCS thrash, and that's why I though a hacky string coercion would be a suitable fix.

@etr2460 Since this affects only the ordering of the yml that is output by the function, there is no change required on the import code.

@Aylr
Copy link
Contributor Author

Aylr commented Jun 25, 2019

What's the next step in the process to get this merged?

@mistercrunch
Copy link
Member

Ok I resolved a conflict, let's move forward with this once CI passes

@mistercrunch
Copy link
Member

Note that it fixes the bug but could also lead to random re-ordering when objects change. Maybe once #7472 lands, we can use the new uuid field as a deterministic way to sort lists of exported objects.

@smacker
Copy link
Contributor

smacker commented Jun 28, 2019

@mistercrunch we have identified more problems with export/import and now consider fixes that we would love to send upstream. The current proposed solution is also to use uuids. You can find the document here: https://docs.google.com/document/d/1vfiAw7yCzqvb3ALo_aiBX3XFPjLNZ1Mira-X7HCK1lI/edit?usp=sharing

@mistercrunch
Copy link
Member

@smacker some work on uuid has been done here #7472 , but it should probably be refactored out into a smaller/simpler PR.

@mistercrunch
Copy link
Member

Also related, found issues that I fixed here as bycatch #7773 in the export_dashboards method. Exporting dashboards would actually break the existing ones in the context of unit tests. Not sure if that was the same in production...

@Aylr
Copy link
Contributor Author

Aylr commented Jul 8, 2019

Ping @mistercrunch what do we need to do to either get this merged or apply another fix? This 5 character PR has been open for 20 days now. What can I do to help?

@mistercrunch mistercrunch merged commit 8c9b4b5 into apache:master Jul 9, 2019
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0 labels Feb 28, 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/XS 🚢 0.34.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exporting Datasource to YAML fails
5 participants