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

refactor: upload data unification, less permissions and less endpoints #31959

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

Conversation

dpgaspar
Copy link
Member

@dpgaspar dpgaspar commented Jan 22, 2025

SUMMARY

This pull request unifies csv, excel and columnar upload endpoints and permissions into a single endpoint and permission type.

This is a breaking change related with Apache Superset 5.0
Removes the following endpoints:

  • POST /api/v1/database/csv_metadata

  • POST /api/v1/database/excel_metadata

  • POST /api/v1/database/columnar_metadata

  • POST /api/v1/database/<id>/csv_upload

  • POST /api/v1/database/<id>/excel_upload

  • POST /api/v1/database/<id>/columnar_upload

And adds the following generic endpoints:

  • POST /api/v1/database/upload_metadata
  • POST /api/v1/database/<id>/upload

Removes the following permissions:
can csv upload on Database
can excel upload on Database
can columnar upload on Database

And adds the following permission: can upload on Database

Includes a db migration that should run fast, depending on the number of roles that include the can <file-type> upload on Database permission.
Upgrade and downgrade were tested, but be aware that we loose granularity when downgrading, since we are converging 3 permissions into 1, the downgrade will always expand the final permission into 3 permissions.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

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

Copy link

korbit-ai bot commented Jan 22, 2025

Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment /korbit-review.

Your admin can change your review schedule in the Korbit Console

@github-actions github-actions bot added risk:db-migration PRs that require a DB migration api Related to the REST API labels Jan 22, 2025
@dpgaspar dpgaspar changed the base branch from 28352-94---remove-can-csv-upload-can-excel-upload-can-columnar-upload-in-favour-of-just-can-upload-on-database to master January 22, 2025 16:49
@dpgaspar dpgaspar changed the title 28352 94 remove can csv upload can excel upload can columnar upload in favour of just can upload on database chore: refactor upload data, less permissions and less endpoints Jan 22, 2025
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 95.34884% with 2 lines in your changes missing coverage. Please review.

Project coverage is 83.43%. Comparing base (76d897e) to head (7817b26).
Report is 1353 commits behind head on master.

Files with missing lines Patch % Lines
superset/databases/api.py 90.47% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #31959       +/-   ##
===========================================
+ Coverage   60.48%   83.43%   +22.94%     
===========================================
  Files        1931      546     -1385     
  Lines       76236    39229    -37007     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    32730    -13384     
+ Misses      28017     6499    -21518     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.78% <48.83%> (-0.39%) ⬇️
javascript ?
mysql 75.99% <48.83%> (?)
postgres 76.06% <48.83%> (?)
presto 53.28% <48.83%> (-0.53%) ⬇️
python 83.43% <95.34%> (+19.94%) ⬆️
sqlite 75.53% <48.83%> (?)
unit 61.02% <95.34%> (+3.40%) ⬆️

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.

@dpgaspar dpgaspar marked this pull request as ready for review January 22, 2025 17:09
Copy link

korbit-ai bot commented Jan 22, 2025

Korbit doesn't automatically review large (500+ lines changed) pull requests such as this one. If you want me to review anyway, use /korbit-review.

@dosubot dosubot bot added the risk:breaking-change Issues or PRs that will introduce breaking changes label Jan 22, 2025
@michael-s-molina michael-s-molina changed the title chore: refactor upload data, less permissions and less endpoints refactor: upload data unification, less permissions and less endpoints Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to the REST API risk:breaking-change Issues or PRs that will introduce breaking changes risk:db-migration PRs that require a DB migration size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

94 - Remove can csv upload, can excel upload, can columnar upload in favour of just can upload on Database
1 participant