betodealmeida opened a new pull request #15578:
URL: https://github.com/apache/superset/pull/15578
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
Add a method to the GSheets DB engine spec to validate parameters from the
new DB modal. This is currently not used, since GSheets is not exposed to the
new modal.
The validation takes a payload that looks like this:
```python
parameters = {
"catalog": {
"private_sheet": "https://docs.google.com/spreadsheets/d/1/edit",
"public_sheet":
"https://docs.google.com/spreadsheets/d/1/edit#gid=1",
"not_a_sheet": "https://www.google.com/",
},
"credentials_info": "SECRET",
}
```
It checks each URL to see if it's accessible, using the credentials if
present, and returns a SIP-40 error payload indicating any URLs not are not
accessible.
Shoutout to @ofekisr for decoupling unit tests from integration tests! The
tests I added are unit tests, though they still require an [app
context](https://flask.palletsprojects.com/en/2.0.x/testing/#the-testing-skeleton).
I created a small fixture to provide that, and added the `pytest-mock` plugin
since it helps keeping tests cleaner.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
N/A
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
Currently this method is a no-op, but I added unit tests and did manual
integration test.
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]