{"record":{"id":"0c0b6fb4e0e19de1","repo":"pola-rs/polars","slug":"didn-t-expect-so-many-arguments","errorCode":null,"errorMessage":"didn't expect so many arguments","messagePattern":"didn't expect so many arguments","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pyo3-polars/pyo3-polars-derive/src/lib.rs","lineNumber":130,"sourceCode":"        })\n        .collect::<Vec<_>>();\n\n    let fn_name = &ast.sig.ident;\n\n    // Get the tokenstream of the call logic.\n    let quote_call = match args.len() {\n        0 => quote_call_no_kwargs(&ast, fn_name),\n        1 => match args[0].as_str() {\n            \"kwargs\" => quote_call_kwargs(&ast, fn_name),\n            \"context\" => quote_call_context(&ast, fn_name),\n            a => panic!(\"didn't expect argument {a}\"),\n        },\n        2 => match (args[0].as_str(), args[1].as_str()) {\n            (\"context\", \"kwargs\") => quote_call_context_kwargs(&ast, fn_name),\n            (\"kwargs\", \"context\") => panic!(\"'kwargs', 'context' order should be reversed\"),\n            (a, b) => panic!(\"didn't expect arguments {a}, {b}\"),\n        },\n        _ => panic!(\"didn't expect so many arguments\"),\n    };\n\n    let quote_process_result = quote_process_results();\n    let fn_name = get_expression_function_name(fn_name);\n\n    quote!(\n        use ::pyo3_polars::export::*;\n\n        // create the outer public function\n        #[no_mangle]\n        pub unsafe extern \"C\" fn #fn_name (\n            e: *mut polars_ffi::version_0::SeriesExport,\n            input_len: usize,\n            kwargs_ptr: *const u8,\n            kwargs_len: usize,\n            return_value: *mut polars_ffi::version_0::SeriesExport,\n            context: *mut polars_ffi::version_0::CallerContext\n        )  {","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/pyo3-polars/pyo3-polars-derive/src/lib.rs#L112-L148","documentation":"Panic in the polars proc-macro attribute parser: the #[polars_expr]-style attribute was given more arguments (or an unexpected combination) than the macro's quote_call match supports — the match on args.len() has no arm for this count, so macro expansion aborts.","triggerScenarios":"Thrown at pyo3-polars/pyo3-polars-derive/src/lib.rs:130 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the number of arguments passed to the attribute to the expected count."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b5d73fd00236295624374b075d16b1fe6ec6df9","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}