{"record":{"id":"4ad84ecbb115afd9","repo":"pola-rs/polars","slug":"activate-round-series-feature","errorCode":null,"errorMessage":"activate 'round_series' feature","messagePattern":"activate 'round_series' feature","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-expr/src/expressions/binary.rs","lineNumber":171,"sourceCode":"            _ => {\n                if right.dtype().is_temporal() {\n                    return left / right;\n                }\n                left.cast(&Float64)? / right.cast(&Float64)?\n            },\n        },\n        Operator::FloorDivide => {\n            #[cfg(feature = \"round_series\")]\n            {\n                floor_div_series(\n                    left.as_materialized_series(),\n                    right.as_materialized_series(),\n                )\n                .map(Column::from)\n            }\n            #[cfg(not(feature = \"round_series\"))]\n            {\n                panic!(\"activate 'round_series' feature\")\n            }\n        },\n        Operator::And => left.bitand(right),\n        Operator::Or => left.bitor(right),\n        Operator::LogicalOr => left\n            .cast(&DataType::Boolean)?\n            .bitor(&right.cast(&DataType::Boolean)?),\n        Operator::LogicalAnd => left\n            .cast(&DataType::Boolean)?\n            .bitand(&right.cast(&DataType::Boolean)?),\n        Operator::Xor => left.bitxor(right),\n        Operator::Modulus => left % right,\n        Operator::EqValidity => left.equal_missing(right).map(|ca| ca.into_column()),\n        Operator::NotEqValidity => left.not_equal_missing(right).map(|ca| ca.into_column()),\n    }\n}\n\nimpl BinaryExpr {","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-expr/src/expressions/binary.rs#L153-L189","documentation":"apply_operator in binary expression evaluation handles arithmetic operators including round-related ones (e.g. Operator::Modulus-style paths gated on `round_series` depending on version). With the `round_series` feature disabled, the corresponding operator branch panics. It means an operator in an expression (left OP right) requires a compile-time feature the build lacks.","triggerScenarios":"Evaluating a binary expression whose Operator maps to the round_series-gated branch (e.g. floor-mod / round-style operations) via apply_operator, reached from apply_operator_owned, apply_elementwise, apply_all_literal, etc., without the `round_series` feature.","commonSituations":"Minimal default-features-off polars builds; expressions deserialized/parsed from another process (e.g. a Python client) whose operators assume features enabled server-side; copying query code that uses % or round-adjacent operators.","solutions":["Enable `round_series` in the polars features in Cargo.toml","Rewrite the expression to avoid the gated operator (e.g. implement modulo/rounding via supported arithmetic or a map/apply)","Check which operator triggers it by logging Operator before apply_operator","Align feature sets between client and server if expressions cross a boundary (e.g. polars-lazy deserialization)"],"exampleFix":"// before\npolars = { version = \"0.46\", default-features = false, features = [\"lazy\"] }\n// after\npolars = { version = \"0.46\", default-features = false, features = [\"lazy\", \"round_series\"] }","handlingStrategy":"try-catch","validationCode":"fn uses_gated_operator(op: Operator) -> bool {\n    // round_series-gated operators (e.g. modulo/round-family in this build)\n    matches!(op, Operator::Modulus) // extend to the actual gated set\n}\nif uses_gated_operator(op) { /* require round_series or rewrite expression */ }","typeGuard":null,"tryCatchPattern":"match std::panic::catch_unwind(|| apply_operator(op, &l, &r)) {\n    Ok(res) => res,\n    Err(_) => return Err(\"operator requires 'round_series' feature\".into()),\n}","preventionTips":["Enable round_series if any user expression can contain the gated operator","Validate/sanitize incoming expressions before execution when features are reduced","Keep client and server polars feature sets aligned when expressions are serialized across processes"],"tags":["rust","polars","feature-flags","operators"],"backgroundTag":"feature-not-enabled","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"}