-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Conversation
Codecov Report
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
superset/db_engine_specs/gsheets.py
Outdated
error_type=SupersetErrorType.CONNECTION_MISSING_PARAMETERS_ERROR, | ||
level=ErrorLevel.WARNING, | ||
extra={"invalid": ["catalog"], "name": "", "url": ""}, | ||
extra={"catalog": {"idx": 0}}, |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idx = 0 | ||
for name, url in table_catalog.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
idx = 0 | |
for name, url in table_catalog.items(): | |
for ixd, (name, url) in enumerate(table_catalog.items()): |
), | ||
) | ||
idx += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If using enumerate
above.
idx += 1 |
🏷 2021.31 |
* setup validates for name * add error type * fix linting * fix test * remove errors * fix number * fix test
* setup validates for name * add error type * fix linting * fix test * remove errors * fix number * fix test
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
Empty Sheet Name
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION