{"record":{"id":"b9d615dd3e3dc98b","repo":"pola-rs/polars","slug":"name-was-removed-in-version-version-hint","errorCode":null,"errorMessage":"`{name}` was removed in version {version}; {hint}","messagePattern":"`(.+?)` was removed in version (.+?); (.+?)","errorType":"exception","errorClass":"AttributeRemovedError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/_utils/expired.py","lineNumber":62,"sourceCode":"    \"\"\"\n    Raise an `AttributeError` for a removed attribute.\n\n    Parameters\n    ----------\n    obj\n        The object from which the attribute was removed.\n    name\n        The name of the removed attribute.\n    attributes\n        A dictionary mapping removed attribute names to hints for replacement.\n    version\n        The version in which the attribute was removed.\n    \"\"\"\n    if name in attributes:\n        hint = attributes[name]\n        msg = f\"`{name}` was removed in version {version}\"\n        msg = f\"{msg}.\" if hint is None else f\"{msg}; {hint}\"\n        raise AttributeRemovedError(msg, name=name, obj=obj)\n\n\ndef getattr_fallback(\n    obj: object, superclass: object, name: str, *, meta: bool = False\n) -> Any:\n    \"\"\"\n    Raise an `AttributeError` for a non-existent attribute.\n\n    Parameters\n    ----------\n    obj\n        The object on which the attribute was accessed.\n    superclass\n        The superclass of the object used to attempt to access the attribute.\n    name\n        The name of the non-existent attribute.\n    meta\n        Whether the object is a metaclass (default: False).","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/_utils/expired.py#L44-L80","documentation":"Polars raises AttributeRemovedError (an AttributeError subclass) when code accesses an attribute that existed in an older Polars version and was explicitly removed. `raise_for_removed_attributes` looks the name up in a registry of removed attributes and includes the removal version and an optional migration hint.","triggerScenarios":"Accessing a removed attribute such as `df.get_columns`-style legacy names, e.g. `series.<old_attr>` or `pl.<old_attr>` after upgrading past the removal version.","commonSituations":"Upgrading Polars across a major change; running old notebooks/scripts; libraries built on Polars that still reference removed attributes.","solutions":["Use the migration hint to find the replacement attribute/method","Consult the Polars changelog for the removal version","Update the calling code to the new API name"],"exampleFix":"// before\ndf.columns0  # removed attribute\n// after\ndf.columns[0]","handlingStrategy":"try-catch","validationCode":"if hasattr(df, \"removed_attr\"):\n    value = df.removed_attr\nelse:\n    value = df.replacement_attr","typeGuard":null,"tryCatchPattern":"try:\n    value = obj.removed_attr\nexcept AttributeError as e:\n    print(e)  # includes version and migration hint\n    value = obj.replacement_attr","preventionTips":["Read the Polars changelog before major upgrades","Fix all deprecation warnings before the removal version ships","Enable warnings-as-errors in CI to surface deprecated attribute usage early"],"tags":["python","polars","attributeerror","api-removal"],"backgroundTag":"deprecated-api-usage","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}