-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
perf: speed up db migration for deprecating time_range_endpoints #19495
perf: speed up db migration for deprecating time_range_endpoints #19495
Conversation
@@ -30,7 +30,6 @@ | |||
|
|||
import sqlalchemy as sa | |||
from alembic import op | |||
from sqlalchemy.dialects import postgresql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bycatch: unused imports
@@ -15,6 +15,7 @@ | |||
# specific language governing permissions and limitations | |||
# under the License. | |||
"""add_saved_query_foreign_key_to_tab_state | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bycatch: this makes superset db history
prettier
@@ -46,8 +46,8 @@ def upgrade(): | |||
bind = op.get_bind() | |||
session = db.Session(bind=bind) | |||
|
|||
for slc in session.query(Slice): | |||
params = json.loads(slc.params or "{}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to fallback when we already filters to slices definitely have params
.
Codecov Report
@@ Coverage Diff @@
## master #19495 +/- ##
==========================================
- Coverage 66.58% 66.54% -0.05%
==========================================
Files 1677 1677
Lines 64238 64238
Branches 6538 6538
==========================================
- Hits 42773 42744 -29
- Misses 19766 19795 +29
Partials 1699 1699
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
SUMMARY
This speeds up db migrations for deprecating
time_range_endpoints
by pre-filtering to the subset of slices with potential changes.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
CI
ADDITIONAL INFORMATION
time_range_endpoints
from query context object #19423 chore: Remove legacy SIP-15 interim logic/flags #18936