Rename old keys to new keys This helps migrate older configuration versions over time See Also -------- check_deprecations
(
deprecations: Mapping[str, str | None] = deprecations, config: dict = config
)
| 723 | |
| 724 | |
| 725 | def rename( |
| 726 | deprecations: Mapping[str, str | None] = deprecations, config: dict = config |
| 727 | ) -> None: |
| 728 | """Rename old keys to new keys |
| 729 | |
| 730 | This helps migrate older configuration versions over time |
| 731 | |
| 732 | See Also |
| 733 | -------- |
| 734 | check_deprecations |
| 735 | """ |
| 736 | for key in deprecations: |
| 737 | try: |
| 738 | value = pop(key, config=config) |
| 739 | except (TypeError, IndexError, KeyError): |
| 740 | continue |
| 741 | key = canonical_name(key, config=config) |
| 742 | new = check_deprecations(key, deprecations) |
| 743 | if new: |
| 744 | set({new: value}, config=config) |
| 745 | |
| 746 | |
| 747 | def check_deprecations( |