Skip to content

Commit

Permalink
Make credentials loading consistent between `KedroContext._get_catalo…
Browse files Browse the repository at this point in the history
…g()` and catalog CLI (#4165)

* Use _get_config_credentials() in catalog CLI

Update RELEASE.md

Signed-off-by: Miguel Rodriguez Gutierrez <[email protected]>

* fix tests

Signed-off-by: Miguel Rodriguez Gutierrez <[email protected]>

* fix test

Signed-off-by: Miguel Rodriguez Gutierrez <[email protected]>

---------

Signed-off-by: Miguel Rodriguez Gutierrez <[email protected]>
  • Loading branch information
MigQ2 authored Sep 20, 2024
1 parent 6bf29f9 commit 13ff99e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
## Bug fixes and other changes
* Fixed bug where using dataset factories breaks with `ThreadRunner`.
* Fixed template projects example tests.
* Made credentials loading consistent between `KedroContext._get_catalog()` and `resolve_patterns` so that both us
e `_get_config_credentials()`

## Breaking changes to the API
* Removed `ShelveStore` to address a security vulnerability.
Expand All @@ -21,6 +23,7 @@
* [Puneet](https://github.com/puneeter)
* [ethanknights](https://github.com/ethanknights)
* [Manezki](https://github.com/Manezki)
* [MigQ2](https://github.com/MigQ2)

# Release 0.19.8

Expand Down
2 changes: 1 addition & 1 deletion kedro/framework/cli/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def resolve_patterns(metadata: ProjectMetadata, env: str) -> None:
context = session.load_context()

catalog_config = context.config_loader["catalog"]
credentials_config = context.config_loader.get("credentials", None)
credentials_config = context._get_config_credentials()
data_catalog = DataCatalog.from_config(
catalog=catalog_config, credentials=credentials_config
)
Expand Down
1 change: 1 addition & 0 deletions tests/framework/cli/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ def test_catalog_resolve(
"catalog": fake_catalog_config,
"credentials": fake_credentials_config,
}
mocked_context._get_config_credentials.return_value = fake_credentials_config
mocked_context.catalog = DataCatalog.from_config(
catalog=fake_catalog_config, credentials=fake_credentials_config
)
Expand Down

0 comments on commit 13ff99e

Please sign in to comment.