-
Notifications
You must be signed in to change notification settings - Fork 781
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
[sk] Improved Configuration Framework #664
Conversation
Can user use combination of the environment variables and plain text in the config yaml? |
By plaintext do you mean the old configuration file syntax? I can add back support for it if needed. |
I wonder whether we can support something like this: https://docs.getdbt.com/reference/dbt-jinja-functions/env_var |
Okay, I can add that. |
Added support for using DBT-style jinja templating notation with environment variables in configuration file. |
mage_ai/io/config.py
Outdated
|
||
class ConfigFileLoader(BaseConfigLoader): | ||
def __init__( | ||
self, filepath: os.PathLike = './default_repo/io_config.yaml', profile='default' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use default_repo here. default_repo is only for development. use get_repo_path()
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
dbf6574
to
7f0965d
Compare
Summary
Introduces a more structured configuration framework, enabling users to have a more robust method to handle authentication features for data IO. Two new features were added:
BaseConfigLoader
, a base class that requires all loader to have the following two functionsget
- get the configuration setting given the respective key. If setting doesn't exist, returns None.contains
- check if the configuration setting corresponding to the given key existsConfigKey
enum). The following template shows how a configuration file with these new keys look:Currently, support for loading from configuration file, environment variables, and AWS Secrets Manager is supported.
Notes
Tests
Unit tests were written to test the behavior of the configuration loaders.
cc:
@wangxiaoyou1993 @dy46