code: def test_asof_join_by_logical_types() -> None:
      dates = (
          pl.datetime_range(
              datetime(2022, 1, 1),
              datetime(2022, 1, 2),
              interval="2h",
              eager=True,
          )
          .cast(pl.Datetime("ns"))
          .head(9)
      )
      x = pl.DataFrame(
          {
              "a": dates,
              "b": map(float, range(9)),
              "c": ["1", "2", "3"] * 3,
          }
      )
  
      result = x.join_asof(
          x, on=pl.col("b").set_sorted(), by=["c", "a"]
      )
  
      expected = {
          "a": [
              datetime(2022, 1, 1, 0, 0),
              datetime(2022, 1, 1, 2, 0),
              datetime(2022, 1, 1, 4, 0),
              datetime(2022, 1, 1, 6, 0),
              datetime(2022, 1, 1, 8, 0),
              datetime(2022, 1, 1, 10, 0),
              datetime(2022, 1, 1, 12, 0),
              datetime(2022, 1, 1, 14, 0),
              datetime(2022, 1, 1, 16, 0),
          ],
          "b": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0],
          "c": ["1", "2", "3", "1", "2", "3", "1", "2", "3"],
      }
      assert result.to_dict(as_series=False) == expected
  
imports: from datetime import date, datetime, timedelta
  from typing import Any
  import numpy
  import pytest
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 11 for calling a global function with example usage: test_asof_join_by_logical_types() without return types