fix: resolve CI/CD test failures and linting issues
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
"""Utilities for flattening and unflattening nested dictionaries."""
|
||||
|
||||
import re
|
||||
from collections.abc import MutableMapping
|
||||
from typing import Any, Dict, List, Tuple
|
||||
from typing import Any, Dict, List
|
||||
|
||||
|
||||
def flatten_dict(data: Dict[str, Any], parent_key: str = "", sep: str = ".") -> Dict[str, Any]:
|
||||
@@ -104,7 +102,6 @@ def _split_key(key: str, sep: str) -> List[str]:
|
||||
def _set_nested(d: Any, parts: List[str], value: Any) -> None:
|
||||
"""Set a value in a nested structure, creating intermediate dicts or lists as needed."""
|
||||
current = d
|
||||
path = [] # Track the path to enable modification at the right level
|
||||
|
||||
for i, part in enumerate(parts[:-1]):
|
||||
if isinstance(current, list):
|
||||
@@ -137,7 +134,7 @@ def _set_nested(d: Any, parts: List[str], value: Any) -> None:
|
||||
current[part] = {}
|
||||
current = current[part]
|
||||
else:
|
||||
raise ValueError(f"Cannot traverse through non-dict/list object")
|
||||
raise ValueError("Cannot traverse through non-dict/list object")
|
||||
|
||||
last_part = parts[-1]
|
||||
if isinstance(current, list):
|
||||
|
||||
Reference in New Issue
Block a user