Hello good evening!
my failure occurs when executing the pg.py file
I followed the documentation
This API isn’t documented.
But you can see which variables are needed in the configuration_schema for any query runner. For example, the postgres query runner can be found here . I pasted the applicable portion below:
{
"type": "object",
"properties": {
"user": {"type": "string"},
"password": {"type": "string"},
"host": {"type": "string", "default": "127.0.0.1"},
"port": {"type": "number", "default": 5432},
…
and I can’t get out of the error.
I would appreciate your help, I am trying to enter the “datasource” programmatically
implement the following solutions without success:
edit “docker_compose.yml”
add line “REDASH_ADDITIONAL_QUERY_RUNNERS:” redash.query_runner.python “”
example in the picture
following the documentation:
Thanks, but this link seems to be for non-docker installation。@ ariarijp
stop service “sudo docker-compose stop”
3.1 delete containers “sudo docker-compose rm”
3.2 re-deploy images redash “sudo docker-compose run --rm server create_db
sudo docker-compose up -d”
jesse
September 23, 2021, 2:52pm
2
This is an import error because of your PYTHONPATH
. But really, you shouldn’t try to execute pg.py
from your terminal. It’s not designed for this at all. Particularly since it imports other assets from the Redash package.
You linked to some instructions I wrote which show you how how to find which fields are required when creating a data source. You do this by looking at the configuration schema for the data source. But you would never actually run the file . You’re just getting the field names so you can make an HTTP request to api/data_sources
with the correct info.
Thanks for your quick response, I still have a question!
in which path do I put the .json file?
jesse:
api/data_sources
it allows me to perform the “API CALL”, but now it gives me this error
jesse
September 23, 2021, 10:04pm
5
What kind of request did you try? GET? POST?
POST Method !
I already found the solution, the error is now authentication.
I am passing the user’s key like this:
jesse
September 23, 2021, 10:17pm
7
That’s not how Redash authenticates
Replace the word basic with key
sorry i am new to using CALL API, i did what you tell me but i keep getting this error.
my problem is that I don’t really know where to put the “api-key”
jesse
September 23, 2021, 10:37pm
9
Key belongs in the quotes.