Skip to content
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

Moved the environment assumption from ConfigLoader to _ProjectSettings #3311

Merged
merged 22 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6a363cf
update release notes
noklam Nov 14, 2023
80b2a78
Remove the default env in config loader - add the env in tests
noklam Nov 15, 2023
ab67d37
remove unncessary `default_run_env`
noklam Nov 15, 2023
6ecbdef
fix tests
noklam Nov 15, 2023
7731883
Added a couple of tests to make sure config loader standalone mode works
noklam Nov 15, 2023
54273f1
Merge branch 'develop' into noklam/remove-the-environment-default-2971
noklam Nov 15, 2023
417874b
fix tests
noklam Nov 15, 2023
ef6769c
Merge branch 'noklam/remove-the-environment-default-2971' of github.c…
noklam Nov 15, 2023
f295f3a
lint
noklam Nov 15, 2023
ffbb45d
Merge branch 'develop' into noklam/remove-the-environment-default-2971
noklam Nov 15, 2023
6ddf591
Fix tests
noklam Nov 16, 2023
0a574d6
update default
noklam Nov 16, 2023
42ba4f9
fix test coverage
noklam Nov 16, 2023
585a472
fix test and lint
noklam Nov 16, 2023
adf72fb
Merge branch 'develop' into noklam/remove-the-environment-default-2971
noklam Nov 17, 2023
42189ea
Merge branch 'develop' into noklam/remove-the-environment-default-2971
noklam Nov 20, 2023
b7d46c3
rename test to 'without_environment' to reflect the change of defaults
noklam Nov 20, 2023
1c30daa
fix tests according to comments
noklam Nov 20, 2023
aa02d6c
update test to test arbitary env explicitly
noklam Nov 21, 2023
c361ac3
Merge branch 'develop' into noklam/remove-the-environment-default-2971
merelcht Nov 21, 2023
7c21f81
Merge branch 'develop' into noklam/remove-the-environment-default-2971
merelcht Nov 21, 2023
92ecbad
Merge branch 'develop' into noklam/remove-the-environment-default-2971
merelcht Nov 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Added the functionality to choose a merging strategy for config files loaded with `OmegaConfigLoader`.
* Modified the mechanism of importing datasets, raise more explicit error when dependencies are missing.
* Added validation for configuration file used to override run commands via the CLI.
* Moved the default environment `base` and `local` from config loader to `_ProjectSettings`. This enable the use of config loader as a standalone class without affecting existing Kedro Project users.
merelcht marked this conversation as resolved.
Show resolved Hide resolved

## Bug fixes and other changes
* Added a new field `add-ons` to `pyproject.toml` when a project is created.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
# CONFIG_LOADER_CLASS = OmegaConfigLoader
# Keyword arguments to pass to the `CONFIG_LOADER_CLASS` constructor.
# CONFIG_LOADER_ARGS = {
# "base_env": "base",
# "default_run_env": "local",
# "config_patterns": {
# "spark" : ["spark*/"],
# "parameters": ["parameters*", "parameters*/**", "**/parameters*"],
Expand Down
8 changes: 4 additions & 4 deletions kedro/config/omegaconf_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def __init__( # noqa: PLR0913
runtime_params: dict[str, Any] = None,
*,
config_patterns: dict[str, list[str]] = None,
base_env: str = "base",
default_run_env: str = "local",
base_env: str = None,
default_run_env: str = None,
custom_resolvers: dict[str, Callable] = None,
merge_strategy: dict[str, str] = None,
):
Expand All @@ -102,8 +102,8 @@ def __init__( # noqa: PLR0913
custom_resolvers: A dictionary of custom resolvers to be registered. For more information,
see here: https://omegaconf.readthedocs.io/en/2.3_branch/custom_resolvers.html#custom-resolvers
"""
self.base_env = base_env
self.default_run_env = default_run_env
self.base_env = base_env or ""
self.default_run_env = default_run_env or ""
self.merge_strategy = merge_strategy or {}

self.config_patterns = {
Expand Down
4 changes: 3 additions & 1 deletion kedro/framework/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ class _ProjectSettings(LazySettings):
"CONFIG_LOADER_CLASS",
default=_get_default_class("kedro.config.OmegaConfigLoader"),
)
_CONFIG_LOADER_ARGS = Validator("CONFIG_LOADER_ARGS", default={})
_CONFIG_LOADER_ARGS = Validator(
"CONFIG_LOADER_ARGS", default={"base_env": "base", "default_run_env": "local"}
)
_DATA_CATALOG_CLASS = _IsSubclassValidator(
"DATA_CATALOG_CLASS", default=_get_default_class("kedro.io.DataCatalog")
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

# Keyword arguments to pass to the `CONFIG_LOADER_CLASS` constructor.
# CONFIG_LOADER_ARGS = {
# "base_env": "base",
# "default_run_env": "local",
# "config_patterns": {
# "spark" : ["spark*/"],
# "parameters": ["parameters*", "parameters*/**", "**/parameters*"],
Expand Down
Loading
Loading