{"record":{"id":"d41b320a6bc2f465","repo":"xai-org/x-algorithm","slug":"config-key-is-deprecated-and-will-be-removed-s","errorCode":null,"errorMessage":"Config '{key}' is deprecated and will be removed soon; use '{normalized}' instead.","messagePattern":"Config '(.+?)' is deprecated and will be removed soon; use '(.+?)' instead\\.","errorType":"console","errorClass":"FutureWarning","httpStatus":null,"severity":"warning","filePath":"phoenix/xrex/configs/xrecsys.py","lineNumber":509,"sourceCode":"class _ConfigRegistry(dict[str, RecsysTrainer]):\n    _DEPRECATED_POSTFIX: str = \"_mask_old_bidir\"\n\n    @classmethod\n    def _normalize_key(cls, key: str) -> tuple[str, bool]:\n        if key.endswith(cls._DEPRECATED_POSTFIX):\n            return key[: -len(cls._DEPRECATED_POSTFIX)], True\n        return key, False\n\n    def __contains__(self, key: object) -> bool:\n        if not isinstance(key, str):\n            return super().__contains__(key)\n        normalized, _ = self._normalize_key(key)\n        return super().__contains__(normalized)\n\n    def __getitem__(self, key: str) -> RecsysTrainer:\n        normalized, deprecated = self._normalize_key(key)\n        if deprecated:\n            warnings.warn(\n                f\"Config '{key}' is deprecated and will be removed soon; use '{normalized}' instead.\",\n                FutureWarning,\n                stacklevel=2,\n            )\n        return super().__getitem__(normalized)\n\n    def get(self, key: str, default: RecsysTrainer | None = None) -> RecsysTrainer | None:\n        normalized, deprecated = self._normalize_key(key)\n        if deprecated:\n            warnings.warn(\n                f\"Config '{key}' is deprecated and will be removed soon; use '{normalized}' instead.\",\n                FutureWarning,\n                stacklevel=2,\n            )\n        return super().get(normalized, default)\n\n\nCONFIGS: dict[str, RecsysTrainer] = _ConfigRegistry()","sourceCodeStart":491,"sourceCodeEnd":527,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/xrex/configs/xrecsys.py#L491-L527","documentation":"FutureWarning emitted by __getitem__ of the xrecsys config registry when a deprecated config key is used. The key is normalized to its replacement before lookup, so the call still succeeds, but the old name will stop working in a future release.","triggerScenarios":"Indexing the config mapping (configs[\"old_name\"]) with a key that _normalize_key flags as deprecated.","commonSituations":"Notebooks or training scripts written against older config names after a renaming migration; copy-pasted config keys from old runbooks.","solutions":["Rename the key to the normalized replacement shown in the warning message","Grep the repo/notebook for the deprecated key and update all uses","Run with -W error::FutureWarning temporarily to find every occurrence"],"exampleFix":"# before\ntrainer = configs[\"ranking_aggregated\"]\n# after\ntrainer = configs[normalized_key_from_warning]","handlingStrategy":"validation","validationCode":"normalized, deprecated = configs._normalize_key(key)\nif deprecated: key = normalized","typeGuard":null,"tryCatchPattern":"with warnings.catch_warnings(record=True) as w:\n    v = configs[key]\n    deprecated_keys.update(x.message for x in w if issubclass(x.category, FutureWarning))","preventionTips":["Run test suites with -W error::FutureWarning to catch deprecations early","Wrap config access in a helper that normalizes keys once"],"tags":["deprecation","python","config","futurewarning"],"backgroundTag":"deprecated-config-key","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}