Skip to content

Conversation

@luizotavio32
Copy link
Contributor

@luizotavio32 luizotavio32 commented Jun 6, 2025

SUMMARY

This PR implements a fix for the legacy charts migration. When a chart has a null query_context , a new query_context will be generated using the migrated form_data . Additionally, the query backup will be saved as null in the backup field queries_bak , ensuring that if the chart is downgraded, the query_context will revert to null .

This change was necessary because executing warm_up_cache for a migrated chart with a null query_context results in the error: Chart's query context does not exist. As a consequence, the chart fails to be cached.

TESTING INSTRUCTIONS

Run superset db upgrade and superset db downgrade CLI commands.

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

@korbit-ai
Copy link

korbit-ai bot commented Jun 6, 2025

Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment /korbit-review.

Your admin can change your review schedule in the Korbit Console

@github-actions github-actions bot added the risk:db-migration PRs that require a DB migration label Jun 6, 2025
@codecov
Copy link

codecov bot commented Jun 6, 2025

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.95%. Comparing base (76d897e) to head (4b7463f).
⚠️ Report is 2203 commits behind head on master.

Files with missing lines Patch % Lines
superset/migrations/shared/migrate_viz/base.py 0.00% 11 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #33710       +/-   ##
===========================================
+ Coverage   60.48%   72.95%   +12.46%     
===========================================
  Files        1931      558     -1373     
  Lines       76236    40282    -35954     
  Branches     8568     4222     -4346     
===========================================
- Hits        46114    29387    -16727     
+ Misses      28017     9804    -18213     
+ Partials     2105     1091     -1014     
Flag Coverage Δ
hive 47.21% <0.00%> (-1.94%) ⬇️
javascript ?
mysql 71.94% <0.00%> (?)
postgres 72.00% <0.00%> (?)
presto 50.97% <0.00%> (-2.84%) ⬇️
python 72.91% <0.00%> (+9.41%) ⬆️
sqlite 71.51% <0.00%> (?)
unit 100.00% <ø> (+42.36%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@luizotavio32 luizotavio32 changed the title Fix: Migrate charts with empty query_context fix: Migrate charts with empty query_context Jun 6, 2025
@luizotavio32 luizotavio32 marked this pull request as ready for review June 6, 2025 19:09
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Functionality Missing Query Builder Implementation ▹ view 🧠 Not in standard
Files scanned
File Path Reviewed
superset/migrations/shared/migrate_viz/base.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

queries = clz._build_query()["queries"]
query_context["queries"] = queries
else:
query_context = clz._build_query()

This comment was marked as resolved.

@michael-s-molina michael-s-molina added the v5.0 Label added by the release manager to track PRs to be included in the 5.0 branch label Jun 6, 2025
@rusackas
Copy link
Member

rusackas commented Jun 6, 2025

Merge?
mailchimp-button

@mistercrunch
Copy link
Member

Was this a blocker for 5.0? Perhaps the only block RN!?

@michael-s-molina
Copy link
Member

Was this a blocker for 5.0? Perhaps the only block RN!?

This was one of the blockers from our side. I'm not sure if it's the only blocker because people didn't vote on RC3 yet 🤷🏼‍♂️

@michael-s-molina michael-s-molina merged commit 08655a7 into apache:master Jun 9, 2025
106 of 107 checks passed
michael-s-molina pushed a commit that referenced this pull request Jun 9, 2025
ianngech pushed a commit to Pesapal-Ltd/superset that referenced this pull request Jun 10, 2025
LevisNgigi pushed a commit to LevisNgigi/superset that referenced this pull request Jun 18, 2025
@mistercrunch mistercrunch added 🍒 5.0.0 Cherry-picked to 5.0.0 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Jul 29, 2025
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 risk:db-migration PRs that require a DB migration size/S v5.0 Label added by the release manager to track PRs to be included in the 5.0 branch 🍒 5.0.0 Cherry-picked to 5.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants