Skip to content

Commit 095fb6c

Browse files
committed
pylint
1 parent 80ab347 commit 095fb6c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/sagemaker/jumpstart/hub/parser_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ def snake_to_upper_camel(snake_case_string: str) -> str:
3030

3131

3232
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
3434
) -> Dict[Any, Any]:
3535
"""Recursively walks a json object and applies a given function to the keys.
3636
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.
3939
"""
4040

4141
def _walk_and_apply_json(json_obj, new):
4242
if isinstance(json_obj, dict) and isinstance(new, dict):
4343
for key, value in json_obj.items():
4444
new_key = apply(key)
45-
if new_key not in stop_keys:
45+
if stop_keys and new_key not in stop_keys:
4646
if isinstance(value, dict):
4747
new[new_key] = {}
4848
_walk_and_apply_json(value, new=new[new_key])

0 commit comments

Comments
 (0)