{"record":{"id":"c0d8d5a8865c6bfe","repo":"pola-rs/polars","slug":"expected-by-arguments-on-both-sides","errorCode":null,"errorMessage":"expected by arguments on both sides","messagePattern":"expected by arguments on both sides","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-ops/src/frame/join/mod.rs","lineNumber":356,"sourceCode":"                        args.slice,\n                        should_coalesce,\n                        options.allow_eq,\n                        options.check_sortedness,\n                    ),\n                    (None, None) => left_df._join_asof(\n                        other,\n                        s_left,\n                        s_right,\n                        options.strategy,\n                        options.tolerance.map(|v| v.into_value()),\n                        args.suffix,\n                        args.slice,\n                        should_coalesce,\n                        options.allow_eq,\n                        options.check_sortedness,\n                    ),\n                    _ => {\n                        panic!(\"expected by arguments on both sides\")\n                    },\n                },\n                #[cfg(feature = \"iejoin\")]\n                JoinType::IEJoin | JoinType::Range => {\n                    unreachable!()\n                },\n                JoinType::Cross => {\n                    unreachable!()\n                },\n            };\n        }\n        let (lhs_keys, rhs_keys) = if (left_df.height() == 0 || other.height() == 0)\n            && matches!(&args.how, JoinType::Inner)\n        {\n            // Fast path for empty inner joins.\n            // Return 2 dummies so that we don't row-encode.\n            let a = Series::full_null(\"\".into(), 0, &DataType::Null);\n            (a.clone(), a)","sourceCodeStart":338,"sourceCodeEnd":374,"githubUrl":"https://github.com/pola-rs/polars/blob/68506541d2de983056c9eb244e1ea05fab377dfc/crates/polars-ops/src/frame/join/mod.rs#L338-L374","documentation":"Join implementation error raised when the `by`/join-key columns expected by the join arguments are missing or mismatched on one side of the join (e.g. in _join_asof dispatch when 'on'/'left_on'/'right_on' resolution yields keys not present in both frames). The message means the join predicate cannot be satisfied on both DataFrames.","triggerScenarios":"This panic/expect fires when execution reaches an unguarded state described by: \"expected by arguments on both sides\". Typical triggers: unsupported dtype or feature-gated code path reached at runtime, invalid user input or environment variable value, calling API methods in the wrong order or on mismatched types, or data (lengths, offsets, ranges) violating the function's preconditions.","commonSituations":"Encountered when input data or configuration does not meet the preconditions of the throwing code path (\"expected by arguments on both sides\"). Common cases: missing Cargo feature flags, mismatched dtypes/lengths between arrays or series, out-of-range temporal values, malformed environment variables, or operations on unsupported/complex nested types.","solutions":["Provide `by`/`left_by`/`right_by` key columns on both sides of the (asof) join.","Check that the by-columns exist in both frames and are named correctly."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"68506541d2de983056c9eb244e1ea05fab377dfc","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}