fix: resolve CI/CD test failures and linting issues
Some checks failed
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled

This commit is contained in:
2026-02-04 07:32:15 +00:00
parent e88b92e69f
commit e16fa6b3d2

View File

@@ -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):