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

perf: speed up db migration for deprecating time_range_endpoints #19495

Merged

Conversation

ktmud
Copy link
Member

@ktmud ktmud commented Apr 1, 2022

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

@ktmud ktmud requested a review from a team as a code owner April 1, 2022 22:32
@@ -30,7 +30,6 @@

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
Copy link
Member Author

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

Copy link
Member Author

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 "{}")
Copy link
Member Author

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
Copy link

codecov bot commented Apr 1, 2022

Codecov Report

Merging #19495 (004cf48) into master (5fed10d) will decrease coverage by 0.04%.
The diff coverage is n/a.

❗ Current head 004cf48 differs from pull request most recent head f01af27. Consider uploading reports for the commit f01af27 to get more accurate results

@@            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              
Flag Coverage Δ
hive 52.69% <ø> (ø)
mysql ?
postgres 81.95% <ø> (ø)
presto 52.54% <ø> (ø)
python 82.29% <ø> (-0.10%) ⬇️
sqlite ?

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

Impacted Files Coverage Δ
superset/common/utils/dataframe_utils.py 85.71% <0.00%> (-7.15%) ⬇️
superset/connectors/sqla/utils.py 89.13% <0.00%> (-5.44%) ⬇️
superset/db_engine_specs/sqlite.py 91.89% <0.00%> (-5.41%) ⬇️
superset/db_engine_specs/mysql.py 93.97% <0.00%> (-3.62%) ⬇️
superset/utils/celery.py 86.20% <0.00%> (-3.45%) ⬇️
superset/result_set.py 96.77% <0.00%> (-1.62%) ⬇️
superset/databases/commands/test_connection.py 98.57% <0.00%> (-1.43%) ⬇️
superset/utils/cache.py 73.58% <0.00%> (-0.95%) ⬇️
superset/models/core.py 88.33% <0.00%> (-0.72%) ⬇️
superset/db_engine_specs/base.py 87.83% <0.00%> (-0.50%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5fed10d...f01af27. Read the comment docs.

@ktmud ktmud merged commit 90dbe8d into apache:master Apr 1, 2022
@john-bodley john-bodley deleted the optimize-deprecate_time_range_endpoints branch June 8, 2022 05:34
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 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 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants