{"record":{"id":"b6f2245b572289dd","repo":"pola-rs/polars","slug":"name-was-removed-in-version-2-0-removed-name","errorCode":null,"errorMessage":"`{name}` was removed in version 2.0; {removed[name]}","messagePattern":"`(.+?)` was removed in version 2\\.0; (.+?)","errorType":"exception","errorClass":"AttributeRemovedError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/__init__.py","lineNumber":554,"sourceCode":"        import polars.datatypes.group as dtgroup\n\n        if name in dir(dtgroup):\n            msg = (\n                f\"`{name}` was deprecated in version 1.0.0. Define your own data type groups or \"\n                \"use the `polars.selectors` module for selecting columns of a certain data type.\"\n            )\n            raise exceptions.AttributeRemovedError(msg)\n\n        # Functions removed in 2.0\n        removed = {\n            \"arctan2d\": \"use `arctan2` followed by `.degrees()` instead.\",\n            \"groups\": \"use `df.with_row_index().group_by(...).agg(pl.col('index'))` instead.\",\n            \"read_csv_batched\": \"use `scan_csv` instead, in conjunction with `LazyFrame.collect(engine='streaming')`.\",\n            \"threadpool_size\": \"it was renamed; use `thread_pool_size` instead.\",\n        }\n        if name in removed:\n            msg = f\"`{name}` was removed in version 2.0; {removed[name]}\"\n            raise exceptions.AttributeRemovedError(msg)\n\n        msg = f\"module {__name__!r} has no attribute {name!r}\"\n        raise AttributeError(msg)\n","sourceCodeStart":536,"sourceCodeEnd":558,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/__init__.py#L536-L558","documentation":"Accessing a function that was removed in polars 2.0 (e.g. `read_csv_batched`, `threadpool_size`, `arctan2d`) raises `AttributeRemovedError` with a replacement hint from a hard-coded `removed` dict in `__getattr__`. The library maps each removed name to a concrete migration instruction and fails immediately so stale call sites are found.","triggerScenarios":"Calling `polars.read_csv_batched`, `polars.threadpool_size`, `polars.arctan2d`, or `DataFrame.groups` on polars >= 2.0 (names present in the removed dict).","commonSituations":"Skipping major-version migration; long-lived internal scripts updated rarely; code relying on renamed APIs like threadpool_size vs thread_pool_size.","solutions":["Follow the per-name hint: use `thread_pool_size`, `scan_csv` with streaming collection, `arctan2` plus `.degrees()`, or group_by with row index.","Read the polars 2.0 migration guide and update all removed call sites.","Pin polars <2.0 only as a temporary stopgap while migrating."],"exampleFix":"// before\nsize = polars.threadpool_size()\n\n// after\nsize = polars.thread_pool_size()","handlingStrategy":"validation","validationCode":"assert not hasattr(polars, 'read_csv_batched'), 'update to scan_csv'","typeGuard":null,"tryCatchPattern":"try:\n    size = polars.threadpool_size()\nexcept AttributeError:\n    size = polars.thread_pool_size()","preventionTips":["Read the major-version changelog before bumping polars across 2.0.","Run your test suite against the new major version in CI before merging the upgrade.","Replace removed APIs (read_csv_batched, threadpool_size, arctan2d, groups) proactively on 1.x."],"tags":["python","polars","removed-api","major-version-upgrade"],"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"}