{"record":{"id":"a11e98afa0203edf","repo":"pola-rs/polars","slug":"not-yet-implemented-a11e98","errorCode":null,"errorMessage":"not yet implemented","messagePattern":"not yet implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-compute/src/comparisons/struct_.rs","lineNumber":102,"sourceCode":"                    is_equal = false;\n                    break;\n                }\n\n                let result = array_tot_eq_missing_kernel(lv[j].as_ref(), rv[j].as_ref());\n                if result.unset_bits() != 0 {\n                    is_equal = false;\n                    break;\n                }\n            }\n\n            bitmap.push(!is_equal);\n        }\n\n        bitmap.freeze()\n    }\n\n    fn tot_eq_kernel_broadcast(&self, _other: &Self::Scalar) -> Bitmap {\n        todo!()\n    }\n\n    fn tot_ne_kernel_broadcast(&self, _other: &Self::Scalar) -> Bitmap {\n        todo!()\n    }\n}\n","sourceCodeStart":84,"sourceCodeEnd":109,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/crates/polars-compute/src/comparisons/struct_.rs#L84-L109","documentation":"StructArray implements array-vs-array total equality (the bitmap loop shown above the stub), but the broadcast variant tot_eq_kernel_broadcast - comparing every struct element against one scalar struct - is a todo!() stub. So a Struct column equals-comparison against a single literal panics with 'not yet implemented' even though column-to-column == works.","triggerScenarios":"pl.col(\"s\") == {\"a\": 1} against a struct column; df.filter(pl.col(\"struct_col\") == pl.struct([pl.lit(1).alias(\"a\")])); Series == scalar struct; any expression where a length-1 struct literal is broadcast against an n-row Struct column.","commonSituations":"Query-builder code that stores coordinates/metadata as struct columns and filters 'rows equal to this constant struct' (matching a specific (x, y) pair or payload snapshot); pipelines that compare two struct columns fine and later switch one side to a literal, then panic.","solutions":["Compare field-by-field: (pl.col(\"s\").struct.field(\"a\") == 1) & (pl.col(\"s\").struct.field(\"b\") == \"x\")","Turn the literal into a same-length struct expression and compare columns, avoiding scalar broadcast: pl.struct([pl.lit(1).alias(\"a\")]) expanded to the frame height","Implement tot_eq_kernel_broadcast for StructArray upstream by reusing the per-field array-vs-array path with broadcast scalars"],"exampleFix":"# before\ndf.filter(pl.col(\"s\") == {\"a\": 1, \"b\": \"x\"})  # todo!: broadcast not implemented\n# after\ndf.filter(\n    (pl.col(\"s\").struct.field(\"a\") == 1)\n    & (pl.col(\"s\").struct.field(\"b\") == \"x\")\n)","handlingStrategy":"fallback","validationCode":"# detect struct-vs-literal comparisons before running the query\nif isinstance(literal, dict) and df.schema[col_name] == pl.Struct:\n    expr = pl.all_horizontal([\n        pl.col(col_name).struct.field(k) == v for k, v in literal.items()\n    ])  # instead of pl.col(col_name) == literal","typeGuard":"def is_struct_column(dtype) -> bool:\n    return isinstance(dtype, pl.Struct) or getattr(dtype, \"base_type\", None) == pl.Struct","tryCatchPattern":"try:\n    df.filter(pl.col(\"s\") == literal)\nexcept pl.exceptions.PanicException:\n    expr = pl.all_horizontal([pl.col(\"s\").struct.field(k) == v for k, v in literal.items()])\n    df = df.filter(expr)","preventionTips":["Standardize on field-wise equality for struct filtering in shared query libraries","Add CI tests covering struct filters with literal right-hand sides","Watch release notes for TotalOrdKernel broadcast coverage on nested dtypes"],"tags":["polars","struct-dtype","comparison","broadcast","panic","todo-macro"],"backgroundTag":"struct-scalar-comparison","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"}