Hello good evening!

my failure occurs when executing the pg.py file

I followed the documentation

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:

  1. edit “docker_compose.yml”

  2. add line “REDASH_ADDITIONAL_QUERY_RUNNERS:” redash.query_runner.python “”

example in the picture

following the documentation:

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

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?

it allows me to perform the “API CALL”, but now it gives me this error

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:

That’s not how Redash authenticates :slight_smile:

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”

Key belongs in the quotes.