Skip to content

fix: Temporal filter conversion in viz migrations #33224

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

michael-s-molina
Copy link
Member

SUMMARY

This PR fixes a bug with the conversion of legacy temporal columns to filters that happens during viz migrations. The problem occurred when generating the filter SQL expression from a custom SQL column. Previously, the SQL expression was missing the time ranges resulting in invalid WHERE clauses.

TESTING INSTRUCTIONS

Create a legacy chart with a temporal column that uses custom SQL and use the CLI to migrate the viz.

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

@github-actions github-actions bot added the risk:db-migration PRs that require a DB migration label Apr 24, 2025
@michael-s-molina michael-s-molina removed the risk:db-migration PRs that require a DB migration label Apr 24, 2025
@dosubot dosubot bot added the change:backend Requires changing the backend label Apr 24, 2025
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 Exclusive End Date Boundary ▹ view 🧠 Incorrect
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

Copy link

codecov bot commented Apr 24, 2025

Codecov Report

Attention: Patch coverage is 72.22222% with 5 lines in your changes missing coverage. Please review.

Project coverage is 83.24%. Comparing base (26ff734) to head (3c9e0bb).
Report is 20 commits behind head on master.

Files with missing lines Patch % Lines
superset/migrations/shared/migrate_viz/base.py 72.22% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #33224       +/-   ##
===========================================
+ Coverage        0   83.24%   +83.24%     
===========================================
  Files           0      553      +553     
  Lines           0    39936    +39936     
===========================================
+ Hits            0    33245    +33245     
- Misses          0     6691     +6691     
Flag Coverage Δ
hive 48.27% <5.55%> (?)
mysql 75.44% <22.22%> (?)
postgres 75.52% <22.22%> (?)
presto 52.75% <5.55%> (?)
python 83.24% <72.22%> (?)
sqlite 75.01% <22.22%> (?)
unit 61.32% <72.22%> (?)

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.

@github-actions github-actions bot added the risk:db-migration PRs that require a DB migration label Apr 24, 2025
@michael-s-molina michael-s-molina force-pushed the fix-temporal-filter-migration branch from c630e6a to 3c9e0bb Compare April 24, 2025 15:34
@michael-s-molina michael-s-molina removed the risk:db-migration PRs that require a DB migration label Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:backend Requires changing the backend size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant