code: def test_categorical_fill_null_existing_category() -> None:
      # ensure physical types align
      df = pl.DataFrame(
          {"col": ["a", None, "a"]}, schema={"col": pl.Categorical}
      )
      result = df.fill_null("a").with_columns(
          pl.col("col").to_physical().alias("code")
      )
      expected = {"col": ["a", "a", "a"], "code": [0, 0, 0]}
      assert result.to_dict(as_series=False) == expected
  
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 30 for calling a global function with example usage: test_categorical_fill_null_existing_category() without return types