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: Make sheet_name into a ValidationInputError #16056

Merged
merged 7 commits into from
Aug 10, 2021

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Aug 4, 2021

SUMMARY

Change the input type for sheet name to ValidationInputError to allow us to show specific errors for this param. We are going to allow user to create a google sheet engine if there is no catalog set.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Empty URL

Screen Shot 2021-08-04 at 1 12 54 AM

Empty Sheet Name

Screen Shot 2021-08-04 at 1 18 27 AM

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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

@codecov
Copy link

codecov bot commented Aug 4, 2021

Codecov Report

Merging #16056 (be37328) into master (69c5cd7) will decrease coverage by 0.09%.
The diff coverage is 37.50%.

❗ Current head be37328 differs from pull request most recent head 3b3c5ae. Consider uploading reports for the commit 3b3c5ae to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16056      +/-   ##
==========================================
- Coverage   76.89%   76.79%   -0.10%     
==========================================
  Files         995      995              
  Lines       52869    52881      +12     
  Branches     6712     6720       +8     
==========================================
- Hits        40651    40608      -43     
- Misses      11992    12047      +55     
  Partials      226      226              
Flag Coverage Δ
hive 81.29% <72.72%> (-0.06%) ⬇️
mysql 81.54% <72.72%> (-0.06%) ⬇️
postgres 81.61% <72.72%> (+0.02%) ⬆️
presto ?
python 81.98% <72.72%> (-0.17%) ⬇️
sqlite 81.25% <72.72%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
...ters/FiltersConfigModal/FiltersConfigForm/utils.ts 90.47% <ø> (ø)
...FormattingControl/ConditionalFormattingControl.tsx 21.66% <0.00%> (-0.75%) ⬇️
...onalFormattingControl/FormattingPopoverContent.tsx 29.26% <0.00%> (-4.07%) ⬇️
superset-frontend/src/reports/actions/reports.js 10.86% <0.00%> (ø)
...c/views/CRUD/data/database/DatabaseModal/styles.ts 81.57% <ø> (ø)
superset/viz.py 56.57% <ø> (ø)
superset-frontend/src/views/CRUD/hooks.ts 47.80% <16.66%> (ø)
.../ReportModal/HeaderReportActionsDropdown/index.tsx 24.32% <25.00%> (-1.39%) ⬇️
.../database/DatabaseModal/DatabaseConnectionForm.tsx 54.00% <33.33%> (ø)
superset/db_engine_specs/gsheets.py 74.73% <50.00%> (-1.93%) ⬇️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 69c5cd7...3b3c5ae. Read the comment docs.

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.

@hughhhh do you mind if we loop @yousoph on this? I don't think we should force users to enter a name:URL pair to set up the connection.

error_type=SupersetErrorType.CONNECTION_MISSING_PARAMETERS_ERROR,
level=ErrorLevel.WARNING,
extra={"invalid": ["catalog"], "name": "", "url": ""},
extra={"catalog": {"idx": 0}},
Copy link
Member

Choose a reason for hiding this comment

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

This makes the API inconsistent — if there's no catalog then there's no index 0. It would be better to return None here, and add a special case to the UI to highlight the first input pair in that case.

catalog: {
name: string;
url: string;
idx: string;
Copy link
Member

Choose a reason for hiding this comment

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

This should be a number. if idx being passed around as a string we should convert it to a number, since that's how we're using it.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Aug 4, 2021
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.

Comment on lines +167 to 168
idx = 0
for name, url in table_catalog.items():
Copy link
Member

Choose a reason for hiding this comment

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

Nit:

Suggested change
idx = 0
for name, url in table_catalog.items():
for ixd, (name, url) in enumerate(table_catalog.items()):

),
)
idx += 1
Copy link
Member

Choose a reason for hiding this comment

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

If using enumerate above.

Suggested change
idx += 1

@hughhhh hughhhh merged commit fd80ae3 into master Aug 10, 2021
@rosemarie-chiu
Copy link
Contributor

🏷 2021.31

opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
* setup validates for name

* add error type

* fix linting

* fix test

* remove errors

* fix number

* fix test
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
* setup validates for name

* add error type

* fix linting

* fix test

* remove errors

* fix number

* fix test
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.0 labels Mar 13, 2024
@mistercrunch mistercrunch deleted the hugh/gsheets-name-validation branch March 26, 2024 17:56
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/L 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants