Skip to content

Commit 0235c76

Browse files
NRL-1215 Add docstrings
1 parent 5bc99cb commit 0235c76

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

layer/nrlf/core/json_duplicate_checker.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44

55
def check_for_duplicate_keys(pairs: list[tuple[str, Any]]) -> dict:
6+
"""Custom JSON object_pairs_hook that checks for duplicate keys."""
67
keys = {}
78
dupes = {}
89
normalized_keys = []
@@ -22,6 +23,7 @@ def check_for_duplicate_keys(pairs: list[tuple[str, Any]]) -> dict:
2223

2324

2425
def flatten_duplicates(data: dict | list) -> list[str]:
26+
"""Flattens a JSON structure and returns a list of duplicate paths."""
2527
duplicates = []
2628
items = data.items() if isinstance(data, dict) else enumerate(data)
2729

0 commit comments

Comments
 (0)