Get the warning message when a key fails the check. Args: key (Any): The key with wrong. Returns: str: The warning message.
(cls, key: Any)
| 1343 | |
| 1344 | @classmethod |
| 1345 | def __get_key_warn_msg__(cls, key: Any) -> str: |
| 1346 | """Get the warning message when a key fails the check. |
| 1347 | |
| 1348 | Args: |
| 1349 | key (Any): |
| 1350 | The key with wrong. |
| 1351 | |
| 1352 | Returns: |
| 1353 | str: |
| 1354 | The warning message. |
| 1355 | """ |
| 1356 | class_name = cls.__name__ |
| 1357 | warn_message = \ |
| 1358 | f'{key} is absent in' +\ |
| 1359 | f' {class_name}.SUPPORTED_KEYS.\n' |
| 1360 | suggestion_message = \ |
| 1361 | 'Ignore this if you know exactly' +\ |
| 1362 | ' what you are doing.\n' +\ |
| 1363 | 'Otherwise, Call self.set_key_strict(True)' +\ |
| 1364 | ' to avoid wrong keys.\n' |
| 1365 | return warn_message + suggestion_message |
| 1366 | |
| 1367 | @classmethod |
| 1368 | def __get_key_error_msg__(cls, key: Any) -> str: |