Tom Chau
12/21/2023, 3:37 AMaaa:
bbb:
aba: "2023-11-01"
abb: "2023-11-01"
abc: 14
I was using Kedro 0.18.2, and running kedro command with the following works fine:
kedro run --pipeline deploy --params="aaa.bbb.aba=2023-12-01, aaa.bbb.abb=2023-12-01"
Recently we are deploying a new image which got the version bumped to 0.18.14, and now the pipelines throws the following error:
KeyError: 'abc'
which implies aaa.bbb.abc in this nested parameter is not presented anymore. May I know is it an expected change? We read the docs but it does not specify nested parameter overwriting rules at runtime (https://docs.kedro.org/en/latest/configuration/parameters.html#how-to-specify-parameters-at-runtime)
and what would the suggested solution for such case? Thanks in advance πTom Chau
12/21/2023, 3:58 AMNok Lam Chan
12/21/2023, 12:48 PMNok Lam Chan
12/21/2023, 1:07 PM.
syntax isn't available in 0.18.2, it is still using the older :
syntax.
kedro run --params="aaa.bbb.aba:2023-12-01, aaa.bbb.abb:2023-12-01"
I get this result in 0.18.2
{'aaa': {'bbb': {'aba': '2023-12-01', 'abb': '2023-12-01', 'abc': 14}}}
and identical result in 0.18.14
{'aaa': {'bbb': {'aba': '2023-12-01', 'abb': '2023-12-01', 'abc': 14}}}
Can you try to work on it in a minimal example?Nok Lam Chan
12/21/2023, 1:09 PMTom Chau
12/21/2023, 4:35 PMkedro run --env=add --params="aaa.bbb.abb=2023-11-11"
From the two images, you can see that only top-level key aaa (which we overwrite at runtime) is affected, other top-level keys (def, xyz) are not.Nok Lam Chan
12/21/2023, 4:40 PMNok Lam Chan
12/21/2023, 4:41 PMβ’ Having a separate env conf (e.g. conf/add/parameters.yml)
Is this related? if you remove the extra parameters does the override key get recovered?
Tom Chau
12/22/2023, 1:43 AMNok Lam Chan
12/22/2023, 12:24 PMRight now it is solved with OmegaConfigLoader with runtime_params. Still I would like to know what the expected behaviour should be πDid you still manage to use runtime_params to solve this issue with env? It's not immediately obvious to me is there a workaround yet.
Nok Lam Chan
12/22/2023, 12:25 PMNok Lam Chan
12/22/2023, 12:31 PMsettings.py
CONFIG_LOADER_ARGS = {
"merge_strategy": {"parameters": "destructive"},
}
Nok Lam Chan
12/22/2023, 12:47 PMmerge_strategy
workaround should work.
For the details, it appears that the parameters that get passed via CLI is set as a parameters in both environments, thus the destructive merging behavior.
kedro run --params="aaa.bbb.abb=2023-11-1199999" --env add
config={'aaa': {'bbb': {'aba': '2023-11-01', 'abb': '2023-11-1199999', 'abc': 14}}, 'xyz': {'asdf': 123123}}
env_config={'def': {'gg': 123}, 'aaa': {'bbb': {'abb': '2023-11-1199999'}}}
resulting_config={'aaa': {'bbb': {'abb': '2023-11-1199999'}}, 'xyz': {'asdf': 123123}, 'def': {'gg': 123}}
Tom Chau
12/22/2023, 1:52 PMTom Chau
12/22/2023, 1:57 PMNok Lam Chan
12/25/2023, 12:22 AMTom Chau
12/27/2023, 1:59 AMNok Lam Chan
01/02/2024, 12:24 PMmerge_strategy
workaround is only available in 0.19. I don't have a timeline of when this will be fixed yet, since I just wrote the ticket before the holiday and it hasn't been discussed by the team. PRs are welcomed if you are interested.Tom Chau
01/03/2024, 3:00 AMSam Yuen
03/04/2024, 1:09 PMSam Yuen
03/04/2024, 1:11 PMNok Lam Chan
03/04/2024, 1:17 PMNok Lam Chan
03/04/2024, 1:17 PMNok Lam Chan
03/04/2024, 1:18 PMNok Lam Chan
03/04/2024, 1:27 PMSam Yuen
03/04/2024, 2:17 PM