EMCP edited a comment on issue #16003:
URL: https://github.com/apache/superset/issues/16003#issuecomment-890598860
Closing issue is okay from my side..
I now have a working JSON to pass which seems to get a good test connection
on POSTGresQL
```
data_out = {
"allow_csv_upload": True,
"allow_ctas": False,
"allow_cvas": False,
"allow_dml": False,
"allow_multi_schema_metadata_fetch": False,
"allow_run_async": False,
"cache_timeout": 0,
"database_name": db_name,
"expose_in_sqllab": True,
"impersonate_user": False,
"sqlalchemy_uri": sqlalchemy_url
}
```
i got a 400 trying to nest another JSON object for default parameters.. and
when I tried to pass a blank one it gave a 500
```
params_str = json.dumps({
"metadata_params": {},
"engine_params": {},
"metadata_cache_timeout": {},
"schemas_allowed_for_csv_upload": []
})
data_out = {
"allow_csv_upload": True,
"allow_ctas": False,
"allow_cvas": False,
"allow_dml": False,
"allow_multi_schema_metadata_fetch": False,
"allow_run_async": False,
"cache_timeout": 0,
"database_name": db_name,
"expose_in_sqllab": True,
"impersonate_user": False,
"sqlalchemy_uri": sqlalchemy_url,
"parameters": params_str
}
```
```
Connected to pydev debugger (build 212.4746.96)
Traceback (most recent call last):
File
"/home/emcp/Tools/pycharm-community-2021.1.1/plugins/python-ce/helpers/pydev/pydevd.py",
line 1483, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File
"/home/emcp/Tools/pycharm-community-2021.1.1/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py",
line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/scratch.py", line 81, in <module>
create_response = create_db_connection(session,
bearer_token=json.loads(response.text)['access_token'],
csrf_token=json.loads(csrf_response.text)['result'], db_ip=db_host,
db_port=db_port, db_user=db_user, db_pass=db_password, db_name=db_name)
File "/scratch.py", line 44, in create_db_connection
response.raise_for_status()
File
"/home/emcp/anaconda3/envs//lib/python3.9/site-packages/requests/models.py",
line 943, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: INTERNAL SERVER ERROR for
url: http://SOMEIP:8088/api/v1/database/
python-BaseException
```
--
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]