{"record":{"id":"7ff769fec3f246c7","repo":"pola-rs/polars","slug":"series-are-equal-but-are-expected-not-to-be","errorCode":null,"errorMessage":"Series are equal (but are expected not to be)","messagePattern":"Series are equal \\(but are expected not to be\\)","errorType":"exception","errorClass":"AssertionError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/testing/asserts/series.py","lineNumber":228,"sourceCode":"\n    _assert_correct_input_type(left, right)\n    try:\n        assert_series_equal(\n            left=left,\n            right=right,\n            check_dtypes=check_dtypes,\n            check_names=check_names,\n            check_order=check_order,\n            check_exact=check_exact,\n            rel_tol=rel_tol,\n            abs_tol=abs_tol,\n            categorical_as_str=categorical_as_str,\n        )\n    except AssertionError:\n        return\n    else:\n        msg = \"Series are equal (but are expected not to be)\"\n        raise AssertionError(msg)\n","sourceCodeStart":210,"sourceCodeEnd":229,"githubUrl":"https://github.com/pola-rs/polars/blob/5d8ebabf11caea54a5c29178a64a058762f49766/py-polars/src/polars/testing/asserts/series.py#L210-L229","documentation":"assert_series_not_equal wraps assert_series_equal in try/except; if the inner comparison does NOT raise, the series match and the else branch raises this AssertionError. Means the negative test failed because left and right are equal under the configured check_dtypes/names/order/exact and tolerances.","triggerScenarios":"Thrown at py-polars/src/polars/testing/asserts/series.py:219 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use `assert_series_equal` if equality is expected; otherwise change the inputs so the series actually differ."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5d8ebabf11caea54a5c29178a64a058762f49766","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}