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

fix(assets import): Ensure old datasource ids are not referenced in imported charts #25086

Merged

Conversation

jfrag1
Copy link
Member

@jfrag1 jfrag1 commented Aug 25, 2023

SUMMARY

#23582 fixed this exact same issue, but only for the dashboard import command. I didn't realize at the time this also needed to be fixed for the assets import command (used by /api/v1/assets/import). It turns out there's a good amount of duplicated code between the different import commands, so the same fix has to be copied here as well.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • 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

@jfrag1 jfrag1 closed this Aug 25, 2023
@jfrag1 jfrag1 reopened this Aug 25, 2023
@jfrag1 jfrag1 closed this Aug 25, 2023
@jfrag1 jfrag1 reopened this Aug 25, 2023
@michael-s-molina
Copy link
Member

@jfrag1 Is is possible to refactor and extract said logic to a utility function or something else to avoid the copy/paste?

@jfrag1
Copy link
Member Author

jfrag1 commented Aug 25, 2023

@jfrag1 Is is possible to refactor and extract said logic to a utility function or something else to avoid the copy/paste?

Yes it is of course possible, but due to the amount of duplication present, I think the refactor required to eliminate this duplication warrants its own PR and review process. Just check the _import methods of ImportDashboardsCommand, ImportChartsCommand, and ImportAssetsCommand to see. IMO it's ok to merge this fix PR separately since it's not really making the duplication harder to untangle (the code copied here is already duplicated between the chart and dashboard import commands).

cc @betodealmeida as I just noticed there's a relevant todo comment he left

@eschutho eschutho merged commit b240b79 into apache:master Aug 28, 2023
58 of 59 checks passed
@eschutho eschutho deleted the jack/fix-assets-import-command-old-ds-id branch August 28, 2023 16:47
@michael-s-molina michael-s-molina added the v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch label Aug 29, 2023
michael-s-molina pushed a commit that referenced this pull request Aug 30, 2023
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 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/S v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants