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

   A clear and concise description of what the bug is.
   
   #### How to reproduce the bug
   
   1. Go to Databases 
   2. Click on Add DuckDB database
   3. Click to Advanced ENGINE PARAMETERS
   4. Parameter Test 1 Fill in Engine Parameters as JSON String with parent Tag 
engine_params:
   `{ "engine_params": { "connect_args":{ "preload_extensions": ["httpfs"], 
"config": { "s3_endpoint": "argo-artifacts:9000", "s3_access_key_id": "XXX", 
"s3_secret_access_key": "XXX", "s3_url_style": "path", "s3_use_ssl": "False" } 
} } }`
   6. Parameter Test 2 Fill in Engine Parameters as JSON String with parent Tag 
connect_args:
   `{ "connect_args":{ "preload_extensions": ["httpfs"], "config": { 
"s3_endpoint": "argo-artifacts:9000", "s3_access_key_id": "XXX", 
"s3_secret_access_key": "XXX", "s3_url_style": "path", "s3_use_ssl": "False" } 
} }`
   
   ### Expected results
   Parameter Test 1 or Parameter Test 2 should be added and used in the 
connection setup.
   
   ### Actual results
   
   We always get the same error:
   ```
   An error occurred while fetching databases: "Connection failed, please check 
your connection settings"
   In chrome debug we see: PUT http://superset.mini.kube/api/v1/database/1 422 
(UNPROCESSABLE ENTITY)
   Response {type: 'basic', url: 'http://superset.mini.kube/api/v1/database/1'
   ```
   
   When we remove the parent tag "engine_params" we get also the error:
   `File "/app/superset/sqllab/sql_json_executer.py", line 111, in execute 
superset raise SupersetErrorsException( superset 
superset.exceptions.SupersetErrorsException: [SupersetError(message="'str' 
object does not support item assignment", 
error_type=<SupersetErrorType.GENERIC_DB`
   
   #### Screenshots
   
   If applicable, add screenshots to help explain your problem.
   
   ### Environment
   
   - browser type and version: Chrome 
   - superset version: newest version from current helm chart
   - python version: version from current helm chart
   - node.js version: version from current helm chart
   - any feature flags active: no
   
   ### Checklist
   
   - [X] I have checked the superset logs for python stacktraces and included 
it here as text if there are any.
   - [ ] I have reproduced the issue with at least the latest released version 
of superset.
   - [ ] I have checked the issue tracker for the same issue and I haven't 
found one similar.
   
   ### Additional context
   
   When looking at the core.py line 394 - 405 it looks like that 
"engine_params" is searched first, then "connect_args"
   https://github.com/apache/superset/blob/master/superset/models/core.py
   
       params = extra.get("engine_params", {})
       if nullpool:
           params["poolclass"] = NullPool
   
       connect_args = params.get("connect_args", {})
       if self.impersonate_user:
           self.db_engine_spec.update_impersonation_config(
               connect_args, str(sqlalchemy_url), effective_username
           )
   
       if connect_args:
           params["connect_args"] = connect_args
   
   In Connector Advanced ENGINE PARAMETER dialog, what is the specific 
connection string which need to be passed ?
   Are the any restrictions in usage of double " or single ' quotes in the JSON 
string ?
   
   This ticket is also raised at 
https://github.com/Mause/duckdb_engine/issues/482 but it looks like its is a 
bug in the dialog and how the connect_args are passed down. 
   
   


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