(compdict: Mapping[Any, Any])
| 33 | ) |
| 34 | |
| 35 | def _map_keys(compdict: Mapping[Any, Any]) -> BaseSettings | dict[Any, Any]: |
| 36 | if isinstance(compdict, BaseSettings): |
| 37 | compbs = BaseSettings() |
| 38 | for k, v in compdict.items(): |
| 39 | prio = compdict.getpriority(k) |
| 40 | assert prio is not None |
| 41 | if compbs.getpriority(convert(k)) == prio: |
| 42 | raise ValueError( |
| 43 | f"Some paths in {list(compdict.keys())!r} " |
| 44 | "convert to the same " |
| 45 | "object, please update your settings" |
| 46 | ) |
| 47 | compbs.set(convert(k), v, priority=prio) |
| 48 | return compbs |
| 49 | _check_components(compdict) |
| 50 | return {convert(k): v for k, v in compdict.items()} |
| 51 | |
| 52 | def _validate_values(compdict: Mapping[Any, Any]) -> None: |
| 53 | """Fail if a value in the components dict is not a real number or None.""" |
no test coverage detected