diff --git a/nvflare/tool/job/config/config_indexer.py b/nvflare/tool/job/config/config_indexer.py index bab342121c..d483f2176e 100644 --- a/nvflare/tool/job/config/config_indexer.py +++ b/nvflare/tool/job/config/config_indexer.py @@ -143,7 +143,13 @@ def build_list_reverse_order_index( def is_primitive(value): - return isinstance(value, int) or isinstance(value, float) or isinstance(value, str) or isinstance(value, bool) + return ( + isinstance(value, int) + or isinstance(value, float) + or isinstance(value, str) + or isinstance(value, bool) + or value is None + ) def has_none_primitives_in_list(values: List): diff --git a/tests/unit_test/tool/job/config/config_indexer_test.py b/tests/unit_test/tool/job/config/config_indexer_test.py index e3f4a807be..9f5a9a8f88 100644 --- a/tests/unit_test/tool/job/config/config_indexer_test.py +++ b/tests/unit_test/tool/job/config/config_indexer_test.py @@ -42,7 +42,6 @@ def test_dict_indexer(self): ) config = CF.from_dict(config_dict) - root_key = KeyIndex(key="", value=config, parent_key=None) x_key = KeyIndex(key="x", value=config.get("x"), parent_key=None) x1_key = KeyIndex(key="x1", value=config.get("x").get("x1"), parent_key=x_key) @@ -149,6 +148,7 @@ def test_extract_file_from_dict_by_index(self): "path": "df_statistics.DFStatistics", "args": { "data_path": "data.csv" + "other_path": null } }, { @@ -164,8 +164,9 @@ def test_extract_file_from_dict_by_index(self): """ conf = CF.parse_string(config_str) key_indices = build_dict_reverse_order_index(config=conf) - result = {} exclude_key_list = [] result = filter_config_name_and_values(exclude_key_list, key_indices) key_index = result["data_path"] assert key_index.value == "data.csv" + key_index = result["other_path"] + assert key_index.value is None