Hi everyone, I am trying to use the APIDataSet in...
# advanced-need-help
x
Hi everyone, I am trying to use the APIDataSet in the catalog.yml file but fail to load some credentials in the headers. What I have tried:
Copy code
run_histograms:
  type: api.APIDataSet
  url: https://xxx/
  headers:
    Authorization: Token <token>
Works without error (which is nice but token is somehow sensitive information). I tried to fill the header using credentials but failed to do so. credentials.yml
Copy code
dqm_playground_token:
  - Content-Type: application/json
  - Authorization: Token <token>
catalog.yml
Copy code
run_histograms:
  type: api.APIDataSet
  url: https://xxx/
  # Test 1
  headers: dqm_playground_token
  # Test 2
  headers:
    - dqm_playground_token
  # More tests
It seems to boil down to the fact that it reads Dict[str, Any] and not Union[Iterable[str], AuthBase]: https://kedro.readthedocs.io/en/stable/_modules/kedro/extras/datasets/api/api_dataset.html#APIDataSet I could probably modify the APIDataSet definition to solve it by having headers = auth but I guess there is a better way. 🙂 Sorry about the naive question. Any help is appreciated.