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

fix: Error when downgrading add_catalog_perm_to_tables migration #29906

Conversation

michael-s-molina
Copy link
Member

SUMMARY

Fixes a error when downgrading revision 58d051681a3b. The previous code was invoking downgrade_catalog_perms after dropping the catalog_perm column which is used by that function, generating an error:

op.drop_column("slices", "catalog_perm")
op.drop_column("tables", "catalog_perm")
downgrade_catalog_perms(engines={"postgresql"})

This PR also rewrites revision 5f57af97bc3f to remove duplicated code.

TESTING INSTRUCTIONS

Check both upgrade and downgrade operations for each migration.

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

@michael-s-molina michael-s-molina requested a review from a team as a code owner August 9, 2024 17:40
@github-actions github-actions bot added the risk:db-migration PRs that require a DB migration label Aug 9, 2024
@dosubot dosubot bot added the risk:breaking-change Issues or PRs that will introduce breaking changes label Aug 9, 2024
@michael-s-molina michael-s-molina removed the risk:breaking-change Issues or PRs that will introduce breaking changes label Aug 9, 2024
Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

Thank you!

@@ -48,6 +48,6 @@ def upgrade():


def downgrade():
downgrade_catalog_perms(engines={"postgresql"})
Copy link
Member

Choose a reason for hiding this comment

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

Oh, good catch!

Copy link

codecov bot commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.72%. Comparing base (76d897e) to head (40939ee).
Report is 966 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #29906       +/-   ##
===========================================
+ Coverage   60.48%   83.72%   +23.23%     
===========================================
  Files        1931      527     -1404     
  Lines       76236    38043    -38193     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    31851    -14263     
+ Misses      28017     6192    -21825     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 49.03% <ø> (-0.14%) ⬇️
javascript ?
mysql 76.78% <ø> (?)
postgres 76.87% <ø> (?)
presto 53.58% <ø> (-0.23%) ⬇️
python 83.72% <ø> (+20.23%) ⬆️
sqlite 76.36% <ø> (?)
unit 60.37% <ø> (+2.75%) ⬆️

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.

Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

double-stamping it, thank you @michael-s-molina for tackling this!

@michael-s-molina michael-s-molina merged commit fb7f508 into apache:master Aug 9, 2024
41 of 42 checks passed
@sadpandajoe
Copy link
Member

@supersetbot label 4.1

@github-actions github-actions bot added the v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch label Aug 9, 2024
sadpandajoe pushed a commit that referenced this pull request Aug 13, 2024
@github-actions github-actions bot added 🍒 4.1.0 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Nov 14, 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 risk:db-migration PRs that require a DB migration size/M v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch 🍒 4.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants