Jagruti Tiwari
12/04/2022, 6:32 AMpython main.py check --config sample_files/config.jsonI get the error saying:
{
"type": "CONNECTION_STATUS",
"connectionStatus": {
"status": "FAILED",
"message": "Config validation error: 'api_key' is a required property"
}
}
In the document it is mentioned to add api key in `secrets/config.json`:
While developing, we recommend storing configs which contain secrets inI generated the api key from the exchange rates api website, added it in thebecause thesecrets/config.jsondirectory is gitignored by default.secrets
secrets/config.json file,
and build the image using this command: docker build . -t airbyte/source-python-http-example:dev .
But the error still persists.
I am contributing towards documentation. It is important for me to understand how connectors work.
Here is the Github link of the partially completed example I was trying: https://github.com/Jagrutiti/airbyte/tree/source-python-http-example-connector/airbyte-integrations/connectors/source-python-http-exampleEli Sigal
12/04/2022, 6:46 AMJagruti Tiwari
12/04/2022, 6:48 AMairbyte-integrations\connectors\source-python-http-example\secrets\config.json
File content:
{
"api_key": "PrXYJ4czaWGTYdv7qo8tOxUvKV5atcYJ"
}Jagruti Tiwari
12/04/2022, 6:49 AMEli Sigal
12/04/2022, 6:50 AMJagruti Tiwari
12/04/2022, 6:51 AMyou need to pass it via config['api_key']Could you give me the exact command here?
Jagruti Tiwari
12/04/2022, 6:51 AMconfig['api_key']?Eli Sigal
12/04/2022, 7:58 AMclass ExchangeRates(HttpStream):
url_base = "<http://api.exchangeratesapi.io/>"
primary_key = None
def __init__(self, config: Mapping[str, Any], **kwargs):
super().__init__()
self.base = config['base']
self.access_key = config['access_key']Jagruti Tiwari
12/04/2022, 8:28 AMdocs\connector-development\tutorials\cdk-tutorial-python-http\declare-schema.md
3. docs\connector-development\tutorials\cdk-tutorial-python-http\read-data.mdBish Sinha
12/04/2022, 6:33 PMself.access_key = config['access_key'] but you should probably change that to self.access_key = config['api_key'] ?Jagruti Tiwari
12/05/2022, 3:07 PMapi_key here: https://github.com/Jagrutiti/airbyte/blob/source-python-http-example-connector/air[…]source-python-http-example/source_python_http_example/source.py
Now when I run the command: python main.py check --config sample_files/invalid_config.json
I get an error saying:
Traceback (most recent call last):
File "airbyte\airbyte-integrations\connectors\source-python-http-example\main.py", line 12, in <module>
source = SourcePythonHttpExample()
TypeError: SourcePythonHttpExample.__init__() missing 1 required positional argument: 'config'
What shall I pass as an argument here?
I did not find any instructions for the same.Eli Sigal
12/06/2022, 6:11 PMJagruti Tiwari
12/07/2022, 4:24 AMEli Sigal
12/07/2022, 10:33 AM