superset icon indicating copy to clipboard operation
superset copied to clipboard

fix(databases): GSheets and Clickhouse DBs are not allowed to upload files

Open Antonio-RiveroMartnez opened this issue 2 years ago • 7 comments

SUMMARY

Our users are getting an Internal Server Error 500 when trying to upload files to GSheets databases, that's because such databases don't support file upload nor the Clickhouse ones thus we need to stop showing such options to the users and prevent that existing ones get displayed in the upload form.

Additionally, schemas allowed field is dependent on having file upload enabled but doesn't appear that way, so we are rendering it only when user checks the Allow file upload checkbox and placing it underneath the file upload checkbox.

Wording changes:

  1. Update field name to : "Allow file uploads to database" instead of "Allow data upload" and remove the tooltip
  2. On the Schemas Allowed field, we should update "CSV Upload" text to be "File Upload" and "CSVs" to "files", including in the hint text

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: error

error

After: test

test

TESTING INSTRUCTIONS

  1. When selecting a DB type, if GSheet or Clickhouse is selected the Allow data upload checkbox is not displayed in the form
  2. Enabled the file upload menu only if there is any exiting DB with allow_file_upload flag set to true and that is not GSheets nor Clickhouse
  3. When the form to file upload files is opened, the Database dropdown must not contain any GSheets nor Clickhouse DB.

ADDITIONAL INFORMATION

  • [X] Has associated issue: https://github.com/apache/superset/issues/19247
  • [ ] Required feature flags:
  • [X] 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

Antonio-RiveroMartnez avatar Aug 12 '22 03:08 Antonio-RiveroMartnez

Codecov Report

Merging #21065 (cc338fe) into master (7938e81) will decrease coverage by 0.00%. The diff coverage is 79.41%.

@@            Coverage Diff             @@
##           master   #21065      +/-   ##
==========================================
- Coverage   66.61%   66.61%   -0.01%     
==========================================
  Files        1791     1791              
  Lines       68559    68586      +27     
  Branches     7319     7325       +6     
==========================================
+ Hits        45671    45686      +15     
- Misses      21002    21017      +15     
+ Partials     1886     1883       -3     
Flag Coverage Δ
hive 52.98% <72.22%> (+0.01%) :arrow_up:
javascript 52.80% <87.50%> (-0.01%) :arrow_down:
mysql 80.83% <72.22%> (-0.01%) :arrow_down:
postgres 80.88% <72.22%> (-0.01%) :arrow_down:
presto 52.88% <72.22%> (+0.01%) :arrow_up:
python 81.35% <72.22%> (-0.01%) :arrow_down:
sqlite 79.43% <72.22%> (-0.01%) :arrow_down:
unit 50.84% <72.22%> (+0.01%) :arrow_up:

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

Impacted Files Coverage Δ
superset-frontend/src/views/components/SubMenu.tsx 86.88% <ø> (ø)
superset/databases/api.py 95.49% <ø> (ø)
superset/views/database/forms.py 85.71% <40.00%> (-3.18%) :arrow_down:
...tend/src/views/CRUD/data/database/DatabaseList.tsx 65.68% <66.66%> (-0.32%) :arrow_down:
superset/models/core.py 88.76% <71.42%> (-0.29%) :arrow_down:
...perset-frontend/src/views/components/RightMenu.tsx 71.31% <83.33%> (+7.97%) :arrow_up:
.../CRUD/data/database/DatabaseModal/ExtraOptions.tsx 86.95% <100.00%> (+3.62%) :arrow_up:
...c/views/CRUD/data/database/DatabaseModal/index.tsx 33.00% <100.00%> (+0.72%) :arrow_up:
superset/db_engine_specs/base.py 88.40% <100.00%> (+0.07%) :arrow_up:
superset/db_engine_specs/clickhouse.py 66.66% <100.00%> (+0.62%) :arrow_up:
... and 5 more

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

codecov[bot] avatar Aug 12 '22 03:08 codecov[bot]

/testenv up

yousoph avatar Aug 17 '22 22:08 yousoph

@yousoph Ephemeral environment spinning up at http://54.201.86.244:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Aug 17 '22 22:08 github-actions[bot]

/testenv up

yousoph avatar Aug 19 '22 00:08 yousoph

@yousoph Ephemeral environment spinning up at http://54.213.205.154:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

github-actions[bot] avatar Aug 19 '22 00:08 github-actions[bot]

Storybook has completed and can be viewed at

github-actions[bot] avatar Aug 24 '22 22:08 github-actions[bot]

Ephemeral environment shutdown and build artifacts deleted.

github-actions[bot] avatar Sep 09 '22 05:09 github-actions[bot]