From 17f3cf0330a6eb21e37d4d61fc1d26289a336bbd Mon Sep 17 00:00:00 2001 From: Amit Ganatra Date: Sun, 14 Dec 2025 14:48:53 -0500 Subject: [PATCH 1/3] proposed fix --- jsonargparse/_typehints.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jsonargparse/_typehints.py b/jsonargparse/_typehints.py index a7fa7fea..39b64198 100644 --- a/jsonargparse/_typehints.py +++ b/jsonargparse/_typehints.py @@ -919,7 +919,11 @@ def adapt_typehints( elif typehint_origin in mapping_origin_types: if isinstance(val, NestedArg): if isinstance(prev_val, dict): - val = {**prev_val, val.key: val.val} + if "." in val.key: + key_prefix, key_suffix = val.key.split(".", 1) + val = {**prev_val, key_prefix: {key_suffix: val.val}} + else: + val = {**prev_val, val.key: val.val} else: val = {val.key: val.val} elif isinstance(val, MappingProxyType): From 81c239afd4b654a3c26886ec9e804576d7969828 Mon Sep 17 00:00:00 2001 From: Amit Ganatra Date: Sun, 14 Dec 2025 15:05:58 -0500 Subject: [PATCH 2/3] check key type --- jsonargparse/_typehints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonargparse/_typehints.py b/jsonargparse/_typehints.py index 39b64198..910ed000 100644 --- a/jsonargparse/_typehints.py +++ b/jsonargparse/_typehints.py @@ -919,7 +919,7 @@ def adapt_typehints( elif typehint_origin in mapping_origin_types: if isinstance(val, NestedArg): if isinstance(prev_val, dict): - if "." in val.key: + if isinstance(val.key, str) and "." in val.key: key_prefix, key_suffix = val.key.split(".", 1) val = {**prev_val, key_prefix: {key_suffix: val.val}} else: From fccc66493e6471dd8e551a67dcddf1e8724d8261 Mon Sep 17 00:00:00 2001 From: Amit Ganatra Date: Sun, 14 Dec 2025 15:16:41 -0500 Subject: [PATCH 3/3] changelog --- CHANGELOG.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 50965891..a2a57b2c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,6 +15,13 @@ paths are considered internals and can change in minor and patch releases. v4.45.0 (unreleased) -------------------- +Fixed +^^^^^ +- Overrides for nested keys in dict. Issue (`#823 + `__). +- ``Issue-823`` (`#824 + `__). + Added ^^^^^ - Signature methods now when given ``sub_configs=True``, list of paths types can