-
Notifications
You must be signed in to change notification settings - Fork 910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I fill the credentials from environment variables #403
Comments
Hey @HugoPerrier -- thanks for creating this issue. It looks like you've gotten it solved with help from Dmitrii and have been kind enough to post your solution so others can benefit from it. I'll go ahead and close this as done. Thank you! |
Hi, i am trying to find the cleanest way to provide credentials as input to a node. Not sure if this is the best place to ask the question. Is there a way to load credentials.yml in the dataCatalog like the parameters.yml. Thanks |
UPDATE for kedro >= 0.18.1It seems like many people are still reading this issues so I'll post an update. The solution proposed above is obsolete. Modify the file project_name/src/package_name/settings.py as follows :
Then you will be able to use environment variables in your conf files. Ex: You can set environment variables MY_LOGIN and MY_PASSWORD.
And your kedro parameters params:my_login and params:my_password will take the value of the corresponding environment variables. ExplanationBy default, kedro uses a regular ConfigLoader object to load the conf files.
By passing os.environ for the global_dict argument, environment variables are made available :) Warning : There is a bug in version 0.18.0 so this solution would raise an error. |
How can we access
|
@schoobani Hey! Sorry that you have to find this old issue. This should be the most up-to-date way to do so. https://docs.kedro.org/en/stable/configuration/advanced_configuration.html#how-to-load-credentials-through-environment-variables |
Issue description
I would like to set placeholders in my credential files and have them filled with environment variables.
Exemple of credentials.yml file (in this case connection to a postgre database):
My solution (thanks DmitriiDeriabinQB and documentation):
Edit the run.py file to :
_create_config_loader
globals_dict
argumentMy run.py file looks as follows:
Originally posted by @HugoPerrier in #49 (comment)
The text was updated successfully, but these errors were encountered: