piopy opened a new issue, #38442:
URL: https://github.com/apache/superset/issues/38442

   ### Bug description
   
   When attempting to connect to Google Sheets and create a database (providing 
JSON credentials for a Service Account), two errors occur.
   1. The URL is not recognized and the error appears in red.
   2. When attempting to query the Google Sheet table, a message appears 
indicating a lack of authorization.
   
   Some useful information:
   - The file (a native Google Sheets file, not an XLSX) has been shared with 
the service account.
   - The service account is on a project with the Google Sheets and Google 
Drive APIs enabled.
   - This occurs on Superset deployed via Docker Compose on an internal server 
(version 6.0.0).
   
   Fix issue n.2 : 
   ```python
   
   # update_params_from_encrypted_extra
   engine = create_engine(
         "gsheets://",
         connect_args={
             "adapter_kwargs": {
                 "gsheetsapi": {
                     "service_account_info": encrypted_credentials,
                     "subject": subject,
                 }
             }
         },
     )
   ```
   
   and 
   
   ```python
   # validate_parameters
    if "oauth2_client_info" in params:
               del params["oauth2_client_info"]
   
   if "service_account_info" in params:
       sa_info = params.pop("service_account_info")
       connect_args = params.setdefault("connect_args", {})
       adapter_kwargs = connect_args.setdefault("adapter_kwargs", {})
       adapter_kwargs.setdefault("gsheetsapi", {})[
           "service_account_info"
       ] = sa_info
   
   if "catalog" in params:
       catalog = params["catalog"]  # keep in params for table listing
       connect_args = params.setdefault("connect_args", {})
       adapter_kwargs = connect_args.setdefault("adapter_kwargs", {})
       adapter_kwargs.setdefault("gsheetsapi", {})["catalog"] = catalog
   ```
   
   ### Screenshots/recordings
   
   
![Image](https://github.com/user-attachments/assets/3acbe2a8-4560-4589-acc0-bd3f58efc5ec)
   
![Image](https://github.com/user-attachments/assets/11874233-d176-4e1b-8f2e-1f9575618a04)
   
   ### Superset version
   
   6.0.0
   
   ### Python version
   
   Not applicable
   
   ### Node version
   
   Not applicable
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [ ] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


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

Reply via email to