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

chore: Drop rouge constraints and tables #24629

Merged

Conversation

john-bodley
Copy link
Member

SUMMARY

Looking at the current schema,

$ rm superset.db
$ FLASK_DEBUG=true superset db upgrade
$ sqlite3 superset.db
sqlite> .tables
ab_permission               metrics                   
ab_permission_view          query                     
ab_permission_view_role     report_execution_log      
ab_register_user            report_recipient          
ab_role                     report_schedule           
ab_user                     report_schedule_user      
ab_user_role                rls_filter_roles          
ab_view_menu                rls_filter_tables         
alembic_version             row_level_security_filters
alert_logs                  saved_query               
alert_owner                 sl_columns                
alerts                      sl_dataset_columns        
annotation                  sl_dataset_tables         
annotation_layer            sl_dataset_users          
cache_keys                  sl_datasets               
clusters                    sl_table_columns          
columns                     sl_tables                 
css_templates               slice_email_schedules     
dashboard_email_schedules   slice_user                
dashboard_roles             slices                    
dashboard_slices            sql_metrics               
dashboard_user              sql_observations          
dashboards                  sqlatable_user            
datasources                 ssh_tunnels               
dbs                         tab_state                 
druiddatasource_user        table_columns             
dynamic_plugin              table_schema              
embedded_dashboards         tables                    
favstar                     tag                       
filter_sets                 tagged_object             
key_value                   url                       
keyvalue                    user_attribute            
logs                      
sqlite> 

it became apparent that there were a number of rouge tables—those which technically were likely dropped in other migrations—but seem to remain in the database. I speculate maybe these were accidentally skipped when resolving a diamond dependency.

This PR adds a migration to drop these tables. Note that the downgrade is a no-op as there's no reference to the underlying schemas in the code pre-migration. I'm made sure the migration is atomic by first checking that the table exists prior to it being dropped.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

CI.

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: < 5 seconds
  • Introduces new feature or API
  • Removes existing feature or API

@john-bodley john-bodley marked this pull request as ready for review July 8, 2023 04:21
@john-bodley john-bodley requested a review from a team as a code owner July 8, 2023 04:21
@john-bodley john-bodley force-pushed the john-bodley--drop-obsolete-tables branch 5 times, most recently from 34ff08f to 968624c Compare July 8, 2023 05:15
@codecov
Copy link

codecov bot commented Jul 8, 2023

Codecov Report

Merging #24629 (585804f) into master (c53b249) will increase coverage by 0.10%.
The diff coverage is n/a.

❗ Current head 585804f differs from pull request most recent head cfa1325. Consider uploading reports for the commit cfa1325 to get more accurate results

@@            Coverage Diff             @@
##           master   #24629      +/-   ##
==========================================
+ Coverage   68.97%   69.08%   +0.10%     
==========================================
  Files        1907     1907              
  Lines       74153    74153              
  Branches     8182     8182              
==========================================
+ Hits        51148    51225      +77     
+ Misses      20882    20805      -77     
  Partials     2123     2123              
Flag Coverage Δ
hive 54.14% <ø> (?)
mysql 79.47% <ø> (?)
postgres 79.56% <ø> (ø)
presto 54.04% <ø> (ø)
python 83.54% <ø> (+0.21%) ⬆️
sqlite 78.12% <ø> (ø)
unit 54.83% <ø> (ø)

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

see 8 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@john-bodley john-bodley force-pushed the john-bodley--drop-obsolete-tables branch from 968624c to b38235a Compare July 8, 2023 05:29
@john-bodley john-bodley force-pushed the john-bodley--drop-obsolete-tables branch from b38235a to cfa1325 Compare July 8, 2023 05:30
@john-bodley john-bodley changed the title chore: Drop rouge tables chore: Drop rouge constraints and tables Jul 8, 2023
Copy link
Member

@craig-rueda craig-rueda left a comment

Choose a reason for hiding this comment

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

At some point it would be great to compact all of these migrations

@john-bodley john-bodley merged commit 65291a0 into apache:master Jul 11, 2023
@john-bodley john-bodley deleted the john-bodley--drop-obsolete-tables branch July 11, 2023 18:37
@michael-s-molina michael-s-molina added the v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch label Jul 11, 2023
michael-s-molina pushed a commit that referenced this pull request Jul 26, 2023
@mistercrunch mistercrunch added 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 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/M v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants