#29354·polars

Workspace feature system

Author: orlpCreated Sep 17, 2026Updated Sep 17, 2026
Labelsenhancement

Polars has a lot of feature flags to turn off functionality you don't need. However ensuring these feature flags are propogated properly, with the right implications, is a complete nightmare. What we would like are workspace features, that unify across the whole workspace. Unfortunately those aren't available right now.

So the next best thing I could think of is that we have a workspace-features.toml which contains entries such as these:

[features]
pl_dtype_array = []
pl_array_arithmetic = ["pl_dtype_array"]
pl_regex = [
    "pl_dtype_string",
    "polars-core/dep:regex",
    "polars-compute/dep:regex",
]

That is, workspace features can imply each other, as well as specific features or optional dependencies in specific member crates.

Then each member crate will have an autogenerated section in the Cargo.toml, which will contain the properly propagated features, respecting optional dependencies:

#[features]
...

### START AUTOGENERATED WORKSPACE FEATURES
pl_array_arithmetic = ["polars-ops/pl_array_arithmetic", "polars-io?/pl_array_arithmetic", "polars-core/pl_array_arithmetic"]
pl_regex = ["pl_dtype_string", "dep:regex"]
pl_dtype_string = ["polars-core/pl_dtype_string"]
### END AUTOGENERATED WORKSPACE FEATURES

These feature sections will be autogenerated using tooling based purely on the workspace-features.toml, as well as any #[cfg(...)] declarations found in the code. The CI would contain steps to make sure this is all done correctly.


The transition to this system would be gradual, converting one or a few features at a time to a pl_workspace_feature.