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(imports): import query_context for imports with charts #30887

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

lindenh
Copy link
Contributor

@lindenh lindenh commented Nov 10, 2024

SUMMARY

Previously, the query_context was removed on imports because of the necessary changes to datasource table ids on import to align with already-existing datasources even if the id itself was different (as it may be across environments).
This became a problem in #28446 as the query context was now required for embedded charts.

This normally isn't an issue, as the query context is generated when saving the chart on the frontend, but if charts are uploaded, this context is removed. This re-adds that imported context with the same changes made to the query_context as made to the imported charts themselves to ensure they point at the right data source.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue: 4.0 - Imported charts shows error on embedding #28446
  • 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

@dosubot dosubot bot added the viz:charts:import Related to importing charts label Nov 10, 2024
@lindenh
Copy link
Contributor Author

lindenh commented Nov 14, 2024

Think you could give this a pat down @betodealmeida ?

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 85.18519% with 4 lines in your changes missing coverage. Please review.

Project coverage is 83.91%. Comparing base (76d897e) to head (164fd3c).
Report is 992 commits behind head on master.

Files with missing lines Patch % Lines
superset/commands/utils.py 80.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #30887       +/-   ##
===========================================
+ Coverage   60.48%   83.91%   +23.42%     
===========================================
  Files        1931      536     -1395     
  Lines       76236    38936    -37300     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    32674    -13440     
+ Misses      28017     6262    -21755     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.85% <22.22%> (-0.31%) ⬇️
javascript ?
mysql 76.78% <85.18%> (?)
postgres 76.87% <85.18%> (?)
presto 53.34% <22.22%> (-0.47%) ⬇️
python 83.91% <85.18%> (+20.42%) ⬆️
sqlite 76.33% <85.18%> (?)
unit 60.87% <44.44%> (+3.25%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@lindenh
Copy link
Contributor Author

lindenh commented Nov 19, 2024

Is this a blocker or can this still be reviewed and merged?

@betodealmeida
Copy link
Member

Ah, let me take a look!

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

This is awesome, thanks for fixing it!

@rusackas rusackas merged commit 8905508 into apache:master Nov 21, 2024
38 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L viz:charts:import Related to importing charts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants