Aspen Olszewska
03/14/2024, 2:50 PMkedro-pandera
plugin to add data validation (might open-source it when it works fine for some time on my comapny's end).
In one of the commands I get the Kedro context through the session:
with KedroSession.create(metadata.package_name, project_path, env=env) as session:
context = session.load_context()
I'm passing the env
here as I iteratively go through the environmnets to create schema files for the datasets selected by passing args to the command.
Fastforward, I try to load a dataset from the Data Catalog:
dataset = context._get_catalog(save_version="")._get_dataset(dataset_name)
And here I experience an error:
$ kedro pandera init --env base
(...)
/usr/local/Caskroom/miniconda/base/envs/liquidity-prediction-env/lib/python3.10/site-packages/kedro/io/data_catalog.py:50 in _get_credentials
KeyError: "Unable to find credentials '<redacted>': check your data catalog and credentials configuration. See <https://kedro.readthedocs.io/en/stable/kedro.io.DataCatalog.html> for an example."
It seems that when I created the session, context, and then the catalog, none of them loaded conf/local/credentials.yml
. Why is that? Is it on purpose (to prevent plugins from stealing credentials) or am I doing something wrong? Why does it work when session, context and catalog are created in the project itself while running kedro run
?
I'm using kedro==0.18.4
.Juan Luis
03/14/2024, 2:51 PMAspen Olszewska
03/14/2024, 2:53 PMAspen Olszewska
03/14/2024, 2:55 PMAspen Olszewska
03/14/2024, 2:56 PMAspen Olszewska
03/14/2024, 2:59 PMJuan Luis
03/14/2024, 3:05 PMNok Lam Chan
03/14/2024, 6:27 PMNok Lam Chan
03/14/2024, 6:28 PMenv="local"
, see if the credentials are loaded properly?Aspen Olszewska
03/14/2024, 6:28 PMNok Lam Chan
03/14/2024, 6:31 PMkedro-pandera
, we started developing it last year but I don't think anyone is using it actively. happy to contribute to something existed already if it open source. Does it supports the feature described in https://github.com/Galileo-Galilei/kedro-pandera/issues?Aspen Olszewska
03/14/2024, 6:31 PMAspen Olszewska
03/14/2024, 6:32 PMconf/local/
...Nok Lam Chan
03/14/2024, 6:33 PMAspen Olszewska
03/14/2024, 6:33 PMAspen Olszewska
03/14/2024, 6:33 PMAspen Olszewska
03/14/2024, 6:34 PMAspen Olszewska
03/14/2024, 6:35 PMNok Lam Chan
03/14/2024, 6:35 PMbase
+ local
(which you can override via cli), there is a long discussion thread about this that I cannot find it now.Nok Lam Chan
03/14/2024, 6:35 PMCONFIG_LOADER_ARGS = {
"base_env": "base",
"default_run_env": "local",
# "config_patterns": {
# "spark" : ["spark*/"],
# "parameters": ["parameters*", "parameters*/**", "**/parameters*"],
# }
}
If you start a new kedro project, you will find this in settings.py
Aspen Olszewska
03/14/2024, 6:35 PMNok Lam Chan
03/14/2024, 6:35 PMNok Lam Chan
03/14/2024, 6:35 PMAspen Olszewska
03/14/2024, 6:36 PMAspen Olszewska
03/14/2024, 6:36 PMAspen Olszewska
03/14/2024, 6:36 PMNok Lam Chan
03/14/2024, 6:37 PMAspen Olszewska
03/14/2024, 6:37 PMAspen Olszewska
03/14/2024, 6:37 PMkedro run
though...Nok Lam Chan
03/14/2024, 6:38 PMNok Lam Chan
03/14/2024, 6:38 PMNok Lam Chan
03/14/2024, 6:38 PMAspen Olszewska
03/14/2024, 6:39 PMAspen Olszewska
03/14/2024, 6:40 PMAspen Olszewska
03/14/2024, 6:40 PMAspen Olszewska
03/14/2024, 6:40 PMNok Lam Chan
03/14/2024, 6:40 PMNok Lam Chan
03/14/2024, 6:41 PMNok Lam Chan
03/14/2024, 6:41 PMAspen Olszewska
03/14/2024, 6:41 PMAspen Olszewska
03/14/2024, 6:41 PMAspen Olszewska
03/14/2024, 6:41 PMAspen Olszewska
03/14/2024, 6:41 PMAspen Olszewska
03/14/2024, 6:41 PMAspen Olszewska
03/14/2024, 6:42 PMAspen Olszewska
03/14/2024, 6:44 PMNok Lam Chan
03/14/2024, 6:46 PMNok Lam Chan
03/15/2024, 7:14 PMkedro run --env base
won't read local
, can you double check?