{"record":{"id":"d94f882ea0585dd0","repo":"pola-rs/polars","slug":"name-was-deprecated-in-version-1-0-0-define-your-own-data","errorCode":null,"errorMessage":"`{name}` was deprecated in version 1.0.0. Define your own data type groups or use the `polars.selectors` module for selecting columns of a certain data type.","messagePattern":"`(.+?)` was deprecated in version 1\\.0\\.0\\. Define your own data type groups or use the `polars\\.selectors` module for selecting columns of a certain data type\\.","errorType":"exception","errorClass":"AttributeRemovedError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/__init__.py","lineNumber":543,"sourceCode":"\n        # Deprecate re-export of exceptions at top-level\n        if name in dir(exceptions):\n            msg = (\n                f\"accessing `{name}` from the top-level `polars` module was deprecated \"\n                \"in version 1.0.0. Import it directly from the `polars.exceptions` module \"\n                f\"instead, e.g.: `from polars.exceptions import {name}`\"\n            )\n            raise exceptions.AttributeRemovedError(msg)\n\n        # Deprecate data type groups at top-level\n        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":525,"sourceCodeEnd":558,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/__init__.py#L525-L558","documentation":"Accessing a legacy data type group (e.g. `polars.FLOATING`, `polars.INTEGER`) from the top-level `polars` module is blocked with `AttributeRemovedError`. Type-group constants were deprecated in 1.0.0 in favor of user-defined dtype collections or the `polars.selectors` module. The library removes them outright so old code fails loudly.","triggerScenarios":"Any `polars.<TypeNameGroup>` attribute access where the name is in `polars.datatypes.group` (e.g. `polars.NUMERIC`, `polars.FLOATING`) on polars >= 1.0.0.","commonSituations":"Migrated code selecting columns by dtype group; old predicates like `df.select(polars.NUMERIC)`; snippets from pre-1.0 documentation or blog posts.","solutions":["Use `polars.selectors` instead: `import polars.selectors as cs` then `df.select(cs.numeric())`, `cs.float()`, etc.","Define your own group: `my_group = [pl.Float32, pl.Float64]` and use `df.select(pl.col(name).is_in(...))` or selectors with `cs.by_dtype(my_group)`.","Grep the codebase for the removed names (`NUMERIC`, `FLOATING`, `INTEGER`, ...) and replace each occurrence."],"exampleFix":"// before\ndf.select(polars.FLOATING)\n\n// after\nimport polars.selectors as cs\ndf.select(cs.float())","handlingStrategy":"validation","validationCode":"import polars.datatypes.group as dtgroup\nassert not hasattr(dtgroup, 'FLOATING') or True  # legacy check","typeGuard":null,"tryCatchPattern":"try:\n    group = polars.FLOATING\nexcept Exception:\n    import polars.selectors as cs\n    group = cs.float()","preventionTips":["Use `polars.selectors` (cs.numeric(), cs.float(), ...) exclusively for dtype-based column selection.","Define explicit dtype lists instead of relying on library-provided groups.","Lint for removed top-level datatype names after upgrading polars."],"tags":["python","polars","deprecation","datatypes","selectors"],"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"}