File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/sagemaker/jumpstart/hub Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -30,19 +30,19 @@ def snake_to_upper_camel(snake_case_string: str) -> str:
30
30
31
31
32
32
def walk_and_apply_json (
33
- json_obj : Dict [Any , Any ], apply , stop_keys : Optional [List [str ]] = []
33
+ json_obj : Dict [Any , Any ], apply , stop_keys : Optional [List [str ]] = None
34
34
) -> Dict [Any , Any ]:
35
35
"""Recursively walks a json object and applies a given function to the keys.
36
36
37
- stop_keys (Optional[list[str]]): List of field keys that should stop the application function. Any
38
- children of these keys will not have the application function applied to them.
37
+ stop_keys (Optional[list[str]]): List of field keys that should stop the application function.
38
+ Any children of these keys will not have the application function applied to them.
39
39
"""
40
40
41
41
def _walk_and_apply_json (json_obj , new ):
42
42
if isinstance (json_obj , dict ) and isinstance (new , dict ):
43
43
for key , value in json_obj .items ():
44
44
new_key = apply (key )
45
- if new_key not in stop_keys :
45
+ if stop_keys and new_key not in stop_keys :
46
46
if isinstance (value , dict ):
47
47
new [new_key ] = {}
48
48
_walk_and_apply_json (value , new = new [new_key ])
You can’t perform that action at this time.
0 commit comments