FredrikBakken opened a new issue #11844:
URL: https://github.com/apache/incubator-superset/issues/11844


   Followed the guides for adding Google Sheets to Superset:
   
   - https://superset.apache.org/docs/databases/google-sheets
   - https://preset.io/blog/2020-06-01-connect-superset-google-sheets/
   
   However, adding `gsheets://` as a new Database returns the following error 
message: `An error occurred while creating databases: "Could not connect to 
database."`
   
   ### Expected results
   
   To be able to successfully add Google Sheets as a Database source.
   
   ### Actual results
   
   The following error message is returned: `An error occurred while creating 
databases: "Could not connect to database."`
   
   #### How to reproduce the bug
   
   1. Clone the repository (version 
[0.38.0](https://github.com/apache/incubator-superset/releases/tag/0.38.0))
   2. Start the docker container: `docker-compose up`
   3. Open Superset on `localhost:8088`(http://localhost:8088/)
   4. Login with `admin:admin`
   5. Go to `Data` -> `Databases`
   6. Click `+ Database`
   7. Add `gsheets://` to `SQLALCHEMY URI*` and click `ADD`
   
   ### Additional context
   
   I was able to bypass this issue by avoiding the following connection check 
in `superset/databases/commands/create.py`:
   ```
   try:
       TestConnectionDatabaseCommand(self._actor, self._properties).run()
   except Exception:
       db.session.rollback()
       raise DatabaseConnectionFailedError()
   ```
   
   Changed to:
   ```
   if not self._properties["sqlalchemy_uri"] == "gsheets://":
       try:
           TestConnectionDatabaseCommand(self._actor, self._properties).run()
       except Exception:
           db.session.rollback()
           raise DatabaseConnectionFailedError()
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to