Validate that only allowed kwargs are present. Raises ValueError if unexpected kwargs are found. Args: kwargs: The handler kwargs dict allowed: Set of allowed kwarg names op_name: Name of the operation (for error message)
(
kwargs: Dict[str, Any],
allowed: Set[str],
op_name: str,
)
| 244 | |
| 245 | |
| 246 | def require_kwargs( |
| 247 | kwargs: Dict[str, Any], |
| 248 | allowed: Set[str], |
| 249 | op_name: str, |
| 250 | ) -> None: |
| 251 | """ |
| 252 | Validate that only allowed kwargs are present. |
| 253 | |
| 254 | Raises ValueError if unexpected kwargs are found. |
| 255 | |
| 256 | Args: |
| 257 | kwargs: The handler kwargs dict |
| 258 | allowed: Set of allowed kwarg names |
| 259 | op_name: Name of the operation (for error message) |
| 260 | """ |
| 261 | unexpected = set(kwargs.keys()) - allowed |
| 262 | if unexpected: |
| 263 | raise ValueError(f"{op_name}: unexpected kwargs: {unexpected}") |
| 264 | |
| 265 | |
| 266 | def require_contiguous_format( |
no test coverage detected