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

feat(csv-upload): Configurable max filesize #24618

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

giftig
Copy link
Contributor

@giftig giftig commented Jul 7, 2023

SUMMARY

Add a validation utility to validate maximum file size when uploading CSVs, and install it on the CsvToDatabaseForm, backed by an optional parameter in application config.

TESTING INSTRUCTIONS

  1. Configure a maximum upload size
  2. Attempt to upload files of varying sizes

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

superset/config.py Outdated Show resolved Hide resolved
@giftig
Copy link
Contributor Author

giftig commented Jul 7, 2023

I got an error while trying to unit test this locally; not sure if there's a bug on the master branch at the moment or if I had an issue with my dependencies, so I've opened the PR a tad early to get a CI build running on it.

@giftig giftig force-pushed the file-size-limit branch 2 times, most recently from 22f4b11 to 2333282 Compare July 7, 2023 14:50
@codecov
Copy link

codecov bot commented Jul 7, 2023

Codecov Report

Merging #24618 (c7f32b8) into master (c53b249) will decrease coverage by 0.56%.
The diff coverage is 100.00%.

❗ Current head c7f32b8 differs from pull request most recent head 1f2e815. Consider uploading reports for the commit 1f2e815 to get more accurate results

@@            Coverage Diff             @@
##           master   #24618      +/-   ##
==========================================
- Coverage   68.97%   68.42%   -0.56%     
==========================================
  Files        1907     1907              
  Lines       74153    74166      +13     
  Branches     8182     8182              
==========================================
- Hits        51148    50749     -399     
- Misses      20882    21294     +412     
  Partials     2123     2123              
Flag Coverage Δ
hive 54.14% <57.14%> (?)
postgres ?
presto 54.04% <57.14%> (-0.01%) ⬇️
python 82.17% <100.00%> (-1.16%) ⬇️
sqlite 78.12% <71.42%> (-0.01%) ⬇️
unit 54.84% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
superset/views/database/forms.py 93.67% <ø> (ø)
superset/config.py 92.17% <100.00%> (+0.02%) ⬆️
superset/forms.py 97.72% <100.00%> (+0.85%) ⬆️

... and 37 files with indirect coverage changes

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

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

LGTM, but leaving it open for additional opinions.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

Looks great!

superset/config.py Outdated Show resolved Hide resolved
Add a validation utility to validate maximum file size when uploading
CSVs, and install it on the CsvToDatabaseForm, backed by an optional
parameter in application config.
@giftig
Copy link
Contributor Author

giftig commented Jul 10, 2023

Looks like the only failure is in the postgres integration tests and that looks like a flaky test ("now" != "a second ago" is very suspicious as test failures go). I've just pushed a rebase anyway so hopefully the next run is successful.

@rusackas rusackas merged commit 88418fc into apache:master Jul 12, 2023
29 checks passed
@mistercrunch mistercrunch added 🏷️ 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 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants