{"record":{"id":"7f7e15531a8e3176","repo":"pola-rs/polars","slug":"didn-t-recognize-attribute","errorCode":null,"errorMessage":"didn't recognize attribute","messagePattern":"didn't recognize attribute","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pyo3-polars/pyo3-polars-derive/src/attr.rs","lineNumber":54,"sourceCode":"\nimpl Parse for ExprsFunctionOptions {\n    fn parse(input: ParseStream<'_>) -> syn::Result<Self> {\n        let mut options = ExprsFunctionOptions::default();\n\n        while !input.is_empty() {\n            let lookahead = input.lookahead1();\n\n            if lookahead.peek(keywords::output_type) {\n                let attr = input.parse::<OutputAttribute>()?;\n                options.output_dtype = Some(attr.value)\n            } else if lookahead.peek(keywords::output_type_func) {\n                let attr = input.parse::<OutputFuncAttribute>()?;\n                options.output_type_fn = Some(attr.value)\n            } else if lookahead.peek(keywords::output_type_func_with_kwargs) {\n                let attr = input.parse::<OutputFuncAttributeWithKwargs>()?;\n                options.output_type_fn_kwargs = Some(attr.value)\n            } else {\n                panic!(\"didn't recognize attribute\")\n            }\n        }\n        Ok(options)\n    }\n}\n","sourceCodeStart":36,"sourceCodeEnd":60,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/pyo3-polars/pyo3-polars-derive/src/attr.rs#L36-L60","documentation":"The #[polars] derive macro's attribute parser (pyo3-polars-derive/src/attr.rs:54) panics with \"didn't recognize attribute\" when it encounters a #[polars(...)] attribute argument it cannot match against the known set (e.g. output_type, output_type_func, output_type_func_with_kwargs, dtype aliases). This is a compile-time proc-macro panic, so the error appears as a rustc build failure, not a runtime exception.","triggerScenarios":"Writing #[polars(some_unknown_option = \"...\")] on a function used with #[derive(PolarsExpression)] / macro exports; misspelling an attribute name or passing an unsupported key-value pair.","commonSituations":"Upgrading pyo3-polars and using attribute names from a different version; copy-pasting attributes from other derive ecosystems (e.g. pyo3); typos like output_type_function.","solutions":["Check the attribute name against the supported list in pyo3-polars-derive (output_type, output_dtype, output_type_func, output_type_func_with_kwargs, etc.) and fix the spelling.","Pin your pyo3-polars version to match documentation/examples you are following, since the accepted attribute set changes between versions.","Remove the unknown attribute and specify the output type via a supported attribute or Rust return type inference."],"exampleFix":"// before\n#[polars(output_type_function = \"my_fn\")]\fn my_expr(x: &Series) -> PolarsResult<Column> { ... }\n// after\n#[polars(output_type_func = \"my_fn\")]\nfn my_expr(x: &Series) -> PolarsResult<Column> { ... }","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use attribute names from the pyo3-polars-derive docs for your pinned version.","Copy attribute usage from the crate's examples/tests rather than other ecosystems.","Let cargo fail fast in CI — this panic is a compile-time error."],"tags":["proc-macro","compile-time","attribute","rust","polars"],"backgroundTag":"invalid-enum-value","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"}