code: def test_categorical_error_on_local_cmp() -> None:
      df_cat = pl.DataFrame(
          [
              pl.Series(
                  "a_cat",
                  ["c", "a", "b", "c", "b"],
                  dtype=pl.Categorical,
              ),
              pl.Series(
                  "b_cat",
                  ["F", "G", "E", "G", "G"],
                  dtype=pl.Categorical,
              ),
          ]
      )
      with pytest.raises(
          StringCacheMismatchError,
          match="cannot compare categoricals coming from different sources",
      ):
          df_cat.filter(pl.col("a_cat") == pl.col("b_cat"))
  
imports: from __future__ import annotations
  import contextlib
  import io
  import operator
  from typing import TYPE_CHECKING, Any, Callable, Literal
  import pytest
  import polars
  from polars import StringCache
  from polars.exceptions import CategoricalRemappingWarning, StringCacheMismatchError
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 16 for calling a global function with example usage: test_categorical_error_on_local_cmp() without return types