Hi again, I have a question regarding credentials:...
# questions
b
Hi again, I have a question regarding credentials: I used
conf/local/credentials.yml
to set a username and password, which is used to download a dataset. As intented, I am not commiting this file to version control. However, now my colleagues cannot run any pipeline without adding a dummy
conf/local/credentials.yml
file first, even when the credentials are not needed for that pipeline, as kedro fails to resolve those credentials. Ideally, I would like the option to add default Credentials, i.e., which are read from env vars, which are overwritten if the
conf/local/credentials.yml
file is available. What is the right approach here?
👀 1
r
Hi @Bjarne Hiller,
However, now my colleagues cannot run any pipeline without adding a dummy
conf/local/credentials.yml
file first, even when the credentials are not needed for that pipeline, as kedro fails to resolve those credentials.
This is a known behavior
Ideally, I would like the option to add default Credentials, i.e., which are read from env vars
Can you try the pattern where there is a base credentials file which gets env defaults and will be overriden by local ?
Copy code
# conf/base/credentials.yml
dataset_auth:
  username: ${oc.env:DATASET_USERNAME, null}
  password: ${oc.env:DATASET_PASSWORD, null}

# conf/local/credentials.yml
dataset_auth:
  username: my-real-username
  password: my-real-password
👍 2
Let me know if this works well for you. Thank you
b
HI @Ravi Kumar Pilla, thank you for your reply. I wasn't aware that Kedro would resolve it like this - if it does indeed override base/credentials with local/credentials, I think this is exactly what I was asking for. Thanks!
👍 1